Ajax DataGrid Support Product Page

Reset Page

Asked 24 Jun 2010 21:49:01
1
has this question
24 Jun 2010 21:49:01 Stephen Hartigan posted:
HI,

I am using the function below to refresh the AjaxDataGrid, the refresh is working fine, however it is staying on the paged results prior to the refresh. So if I am viewing page 3 of 10 pages then refresh the grid is staying on page 3 (which may now have no records). How can I reset to page 1? here is my refresh function:

function controlAjaxDataGrid(scope, id, action) {//v1.3
var j = window.$ || null, scope = scope || document;
if (scope != document && scope.document) {
j = scope.$ || null;
scope = scope.document;
}
if (!j) return;
var tgt = scope.getElementById(id);
if (tgt && tgt.grid) {
switch (action) {
case 'reload' :j('#' + id, scope).flexReload();break;
case 'goToPage' :tgt.grid.changePage(arguments[3] || '');break;
case 'setFilter':
if (arguments[3] && arguments[3] == 'custom') {
j('#' + id, scope).setFilter(
arguments[4] || '',
arguments[5] || '',
arguments[6] || ''
);
} else if (arguments[3] && arguments[3] == 'form') {
j('#' + id, scope).setFilter(
arguments[4] || '',
arguments[5] || '',
arguments[6] ? $(arguments[6]).val() : ''
);
}
break;
}
}
}

Replies

Replied 24 Jun 2010 22:10:47
24 Jun 2010 22:10:47 Stephen Hartigan replied:
it's OK got it![]
Replied 25 Jun 2010 10:01:21
25 Jun 2010 10:01:21 Miroslav Zografski replied:
Hello Stephen,

Using the changPage() into the refresh sequence will do the job.

Regards,

Reply to this topic