Pager: Add url check to allow ajax updating of table. Fixes #730

This commit is contained in:
Mottie 2014-09-28 08:37:47 -05:00
parent 235fc037fa
commit 6fbdc1a3b9
2 changed files with 6 additions and 2 deletions

View File

@ -661,6 +661,7 @@
// don't allow rendering multiple times on the same page/size/totalRows/filters/sorts
if ( l.page === p.page && l.size === p.size && l.totalRows === p.totalRows &&
(l.currentFilters || []).join(',') === (p.currentFilters || []).join(',') &&
(l.ajaxUrl || '') === (p.ajaxObject.url || '') &&
l.sortList === (c.sortList || []).join(',') ) { return; }
if (c.debug) {
ts.log('Pager changing to page ' + p.page);
@ -671,7 +672,8 @@
// fixes #408; modify sortList otherwise it auto-updates
sortList : (c.sortList || []).join(','),
totalRows : p.totalRows,
currentFilters : p.currentFilters || []
currentFilters : p.currentFilters || [],
ajaxUrl : p.ajaxObject.url || ''
};
if (p.ajax) {
getAjax(table, p);

View File

@ -886,6 +886,7 @@ tsp = ts.pager = {
// don't allow rendering multiple times on the same page/size/totalRows/filters/sorts
if ( l.page === p.page && l.size === p.size && l.totalRows === p.totalRows &&
(l.currentFilters || []).join(',') === (p.currentFilters || []).join(',') &&
(l.ajaxUrl || '') === (p.ajaxObject.url || '') &&
l.sortList === (c.sortList || []).join(',') ) {
return;
}
@ -898,7 +899,8 @@ tsp = ts.pager = {
// fixes #408; modify sortList otherwise it auto-updates
sortList : (c.sortList || []).join(','),
totalRows : p.totalRows,
currentFilters : p.currentFilters || []
currentFilters : p.currentFilters || [],
ajaxUrl : p.ajaxObject.url || ''
};
if (p.ajax) {
tsp.getAjax(table, c);