Fix forced search

This commit is contained in:
Mottie 2013-12-08 22:11:32 -06:00
parent e8839b1660
commit a1ea07dc15
2 changed files with 9 additions and 5 deletions

View File

@ -64,7 +64,7 @@
c.filter_childRows = o;
$('.state').html(o.toString());
// update filter; include false parameter to force a new search
$('input.tablesorter-filter').trigger('search', false);
$('table').trigger('search', false);
return false;
});

View File

@ -371,7 +371,7 @@ ts.addWidget({
$table
.removeClass('hasFilters')
// add .tsfilter namespace to all BUT search
.unbind('addRows updateCell update updateComplete appendCache search filterStart filterEnd '.split(' ').join('.tsfilter '))
.unbind('addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search '.split(' ').join('.tsfilter '))
.find('.tablesorter-filter-row').remove();
for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
$tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // remove tbody
@ -555,8 +555,7 @@ ts.filter = {
}
if (event.type === 'filterReset') {
ts.filter.searching(table, []);
}
if (event.type === 'filterEnd') {
} else if (event.type === 'filterEnd') {
ts.filter.buildDefault(table, true);
} else {
// send false argument to force a new search; otherwise if the filter hasn't changed, it will return
@ -754,7 +753,12 @@ ts.filter = {
}
// return if the last search is the same; but filter === false when updating the search
// see example-widget-filter.html filter toggle buttons
if (c.lastCombinedFilter === combinedFilters && filter !== false) { return; }
if (c.lastCombinedFilter === combinedFilters && filter !== false) {
return;
} else if (filter === false) {
// force filter refresh
c.lastCombinedFilter = null;
}
c.$table.trigger('filterStart', [filters]);
if (c.showProcessing) {
// give it time for the processing icon to kick in