mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Filter: fix filterDefault issue with using class selectors
This commit is contained in:
parent
6bec32a44b
commit
336d519d07
@ -1005,6 +1005,7 @@ ts.filter = {
|
|||||||
},
|
},
|
||||||
defaultFilter: function(filter, mask){
|
defaultFilter: function(filter, mask){
|
||||||
if (filter === '') { return filter; }
|
if (filter === '') { return filter; }
|
||||||
|
console.log(filter, mask);
|
||||||
var regex = ts.filter.regex.iQuery,
|
var regex = ts.filter.regex.iQuery,
|
||||||
maskLen = mask.match( ts.filter.regex.igQuery ).length,
|
maskLen = mask.match( ts.filter.regex.igQuery ).length,
|
||||||
query = maskLen > 1 ? $.trim(filter).split(/\s/) : [ $.trim(filter) ],
|
query = maskLen > 1 ? $.trim(filter).split(/\s/) : [ $.trim(filter) ],
|
||||||
@ -1104,7 +1105,7 @@ ts.filter = {
|
|||||||
data.anyMatchFilter = ts.replaceAccents(data.anyMatchFilter);
|
data.anyMatchFilter = ts.replaceAccents(data.anyMatchFilter);
|
||||||
}
|
}
|
||||||
if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || '')) {
|
if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || '')) {
|
||||||
data.anyMatchFilter = ts.filter.defaultFilter(data.anyMatchFilter, wo.filter_defaultFilter[c.columns]);
|
data.anyMatchFilter = ts.filter.defaultFilter( data.anyMatchFilter, ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) );
|
||||||
// clear search filtered flag because default filters are not saved to the last search
|
// clear search filtered flag because default filters are not saved to the last search
|
||||||
searchFiltered = false;
|
searchFiltered = false;
|
||||||
}
|
}
|
||||||
@ -1200,7 +1201,7 @@ ts.filter = {
|
|||||||
data.filter = c.sortLocaleCompare ? ts.replaceAccents(data.filter) : data.filter;
|
data.filter = c.sortLocaleCompare ? ts.replaceAccents(data.filter) : data.filter;
|
||||||
|
|
||||||
if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '')) {
|
if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '')) {
|
||||||
data.filter = ts.filter.defaultFilter(data.filter, wo.filter_defaultFilter[columnIndex]);
|
data.filter = ts.filter.defaultFilter( data.filter, ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) );
|
||||||
}
|
}
|
||||||
// val = case insensitive, columnFilter = case sensitive
|
// val = case insensitive, columnFilter = case sensitive
|
||||||
data.iFilter = wo.filter_ignoreCase ? (data.filter || '').toLocaleLowerCase() : data.filter;
|
data.iFilter = wo.filter_ignoreCase ? (data.filter || '').toLocaleLowerCase() : data.filter;
|
||||||
|
Loading…
Reference in New Issue
Block a user