mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Prevent filter error. Fixes #432
This commit is contained in:
parent
651957606d
commit
7b1699c955
@ -635,13 +635,14 @@ ts.filter = {
|
|||||||
c.$table.trigger('filterInit');
|
c.$table.trigger('filterInit');
|
||||||
},
|
},
|
||||||
setDefaults: function(table, c, wo) {
|
setDefaults: function(table, c, wo) {
|
||||||
var indx,
|
var indx, isArray,
|
||||||
filters = [],
|
filters = [],
|
||||||
columns = c.columns;
|
columns = c.columns;
|
||||||
if (wo.filter_saveFilters && ts.storage) {
|
if (wo.filter_saveFilters && ts.storage) {
|
||||||
filters = ts.storage( table, 'tablesorter-filters' ) || [];
|
filters = ts.storage( table, 'tablesorter-filters' ) || [];
|
||||||
|
isArray = $.isArray(filters);
|
||||||
// make sure we're not just saving an empty array
|
// make sure we're not just saving an empty array
|
||||||
if (filters.join('') === '') { filters = []; }
|
if (isArray && filters.join('') === '' || !isArray ) { filters = []; }
|
||||||
}
|
}
|
||||||
// if not filters saved, then check default settings
|
// if not filters saved, then check default settings
|
||||||
if (!filters.length) {
|
if (!filters.length) {
|
||||||
|
Loading…
Reference in New Issue
Block a user