mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
addRows method now works on an empty table. Fixes #450
This commit is contained in:
parent
d81d64f418
commit
328bba34a7
@ -612,7 +612,7 @@
|
||||
}
|
||||
|
||||
$t
|
||||
.unbind('filterStart filterEnd sortEnd disable enable destroy update pageSize '.split(' ').join('.pager '))
|
||||
.unbind('filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize '.split(' ').join('.pager '))
|
||||
.bind('filterStart.pager', function(e, filters) {
|
||||
p.currentFilters = filters;
|
||||
})
|
||||
@ -636,7 +636,7 @@
|
||||
e.stopPropagation();
|
||||
destroyPager(table, p);
|
||||
})
|
||||
.bind('update.pager', function(e){
|
||||
.bind('update updateRows updateAll addRows '.split(' ').join('.pager '), function(e){
|
||||
e.stopPropagation();
|
||||
hideRows(table, p);
|
||||
})
|
||||
|
@ -814,6 +814,11 @@
|
||||
})
|
||||
.bind("addRows.tablesorter", function(e, $row, resort, callback) {
|
||||
e.stopPropagation();
|
||||
if (isEmptyObject(c.cache)) {
|
||||
// empty table, do an update instead - fixes #450
|
||||
updateHeader(table);
|
||||
commonUpdate(table, resort, callback);
|
||||
} else {
|
||||
var i, rows = $row.filter('tr').length,
|
||||
dat = [], l = $row[0].cells.length,
|
||||
tbdy = $this.find('tbody').index( $row.parents('tbody').filter(':first') );
|
||||
@ -836,6 +841,7 @@
|
||||
}
|
||||
// resort using current settings
|
||||
checkResort($this, resort, callback);
|
||||
}
|
||||
})
|
||||
.bind("sorton.tablesorter", function(e, list, callback, init) {
|
||||
var c = table.config;
|
||||
|
@ -200,7 +200,7 @@ tsp = ts.pager = {
|
||||
s = wo.pager_selectors;
|
||||
|
||||
c.$table
|
||||
.unbind('filterStart filterEnd sortEnd disable enable destroy update pageSize '.split(' ').join('.pager '))
|
||||
.unbind('filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize '.split(' ').join('.pager '))
|
||||
.bind('filterStart.pager', function(e, filters) {
|
||||
p.currentFilters = filters;
|
||||
})
|
||||
@ -224,7 +224,7 @@ tsp = ts.pager = {
|
||||
e.stopPropagation();
|
||||
tsp.destroyPager(table, c);
|
||||
})
|
||||
.on('update.pager', function(e){
|
||||
.on('update updateRows updateAll addRows '.split(' ').join('.pager '), function(e){
|
||||
e.stopPropagation();
|
||||
tsp.hideRows(table, c);
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user