Skip to content

Commit

Permalink
Fixed issues with filter_columnFilters set to false. Fixes #355
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Oct 10, 2013
1 parent d0adfe2 commit ab5ceb9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions js/jquery.tablesorter.widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ ts.addWidget({
buildDefault(true);
}
if (e.type === 'filterReset') {
$t.find('.tablesorter-filter').val('');
searching([]);
}
if (e.type === 'filterEnd') {
buildDefault(true);
Expand Down Expand Up @@ -786,10 +786,13 @@ ts.addWidget({
// add default values
$t.bind('tablesorter-initialized', function(){
ff = ts.getFilters(table);
for (i = 0; i < ff.length; i++) {
ff[i] = $ths.filter('[data-column="' + i + '"]:last').attr(wo.filter_defaultAttrib) || ff[i];
// ff is undefined when filter_columnFilters = false
if (ff) {
for (i = 0; i < ff.length; i++) {
ff[i] = $ths.filter('[data-column="' + i + '"]:last').attr(wo.filter_defaultAttrib) || ff[i];
}
ts.setFilters(table, ff, true);
}
ts.setFilters(table, ff, true);
});
// filter widget initialized
$t.trigger('filterInit');
Expand Down

0 comments on commit ab5ceb9

Please sign in to comment.