mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Pager: ensure ajax is called after filter widget initializes
This commit is contained in:
parent
f7a60232a8
commit
30ee40c33f
@ -244,12 +244,15 @@
|
|||||||
wo = c.widgetOptions,
|
wo = c.widgetOptions,
|
||||||
namespace = c.namespace + 'pager',
|
namespace = c.namespace + 'pager',
|
||||||
s = wo.pager_selectors;
|
s = wo.pager_selectors;
|
||||||
|
|
||||||
c.$table
|
c.$table
|
||||||
.off( namespace )
|
.off( namespace )
|
||||||
.on( 'filterInit filterStart '.split( ' ' ).join( namespace + ' ' ), function( e, filters ) {
|
.on( 'filterInit filterStart '.split( ' ' ).join( namespace + ' ' ), function( e, filters ) {
|
||||||
p.currentFilters = $.isArray( filters ) ? filters : c.$table.data( 'lastSearch' );
|
p.currentFilters = $.isArray( filters ) ? filters : c.$table.data( 'lastSearch' );
|
||||||
var filtersEqual;
|
var filtersEqual;
|
||||||
|
if (p.ajax && e.type === 'filterInit') {
|
||||||
|
// ensure pager ajax is called after filter widget has initialized
|
||||||
|
return tsp.moveToPage( c, p, false );
|
||||||
|
}
|
||||||
if (ts.filter.equalFilters) {
|
if (ts.filter.equalFilters) {
|
||||||
filtersEqual = ts.filter.equalFilters(c, c.lastSearch, p.currentFilters);
|
filtersEqual = ts.filter.equalFilters(c, c.lastSearch, p.currentFilters);
|
||||||
} else {
|
} else {
|
||||||
@ -270,7 +273,6 @@
|
|||||||
tsp.updateCache( c );
|
tsp.updateCache( c );
|
||||||
}
|
}
|
||||||
tsp.updatePageDisplay( c, false );
|
tsp.updatePageDisplay( c, false );
|
||||||
// tsp.moveToPage( c, p, false ); <-- called when applyWidgets is triggered
|
|
||||||
ts.applyWidget( c.table );
|
ts.applyWidget( c.table );
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user