Filter: restore column specific default filters. Fixes #1088

The code was accidentally removed in v2.24.4
This commit is contained in:
Rob Garrison 2015-12-02 13:36:47 -06:00
parent b84b38e6fa
commit 9adc837253
10 changed files with 64 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 12-01-2015 (v2.24.6)*/
/*! tablesorter (FORK) - updated 12-02-2015 (v2.24.6)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -406,7 +406,10 @@
})
.bind( 'applyWidgetId' + namespace, function( e, id ) {
e.stopPropagation();
ts.getWidgetById( id ).format( this, this.config, this.config.widgetOptions );
var widget = ts.getWidgetById( id );
if ( widget ) {
widget.format( this, this.config, this.config.widgetOptions );
}
})
.bind( 'applyWidgets' + namespace, function( e, init ) {
e.stopPropagation();
@ -1275,6 +1278,11 @@
// problems with element focus
ts.resortComplete( c, callback );
}
} else {
if ( c.debug ) {
console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
}
c.table.isUpdating = false;
}
},
@ -4103,6 +4111,11 @@
data.filter = ts.replaceAccents( data.filter );
}
// replace column specific default filters - see #1088
if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) {
data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] );
}
// data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ),
// data.filter = case sensitive
data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter;

File diff suppressed because one or more lines are too long

View File

@ -404,7 +404,10 @@
})
.bind( 'applyWidgetId' + namespace, function( e, id ) {
e.stopPropagation();
ts.getWidgetById( id ).format( this, this.config, this.config.widgetOptions );
var widget = ts.getWidgetById( id );
if ( widget ) {
widget.format( this, this.config, this.config.widgetOptions );
}
})
.bind( 'applyWidgets' + namespace, function( e, init ) {
e.stopPropagation();
@ -1273,6 +1276,11 @@
// problems with element focus
ts.resortComplete( c, callback );
}
} else {
if ( c.debug ) {
console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
}
c.table.isUpdating = false;
}
},

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 12-01-2015 (v2.24.6)*/
/*! tablesorter (FORK) - updated 12-02-2015 (v2.24.6)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -1457,6 +1457,11 @@
data.filter = ts.replaceAccents( data.filter );
}
// replace column specific default filters - see #1088
if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) {
data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] );
}
// data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ),
// data.filter = case sensitive
data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 12-01-2015 (v2.24.6)*/
/*! tablesorter (FORK) - updated 12-02-2015 (v2.24.6)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -412,7 +412,10 @@
})
.bind( 'applyWidgetId' + namespace, function( e, id ) {
e.stopPropagation();
ts.getWidgetById( id ).format( this, this.config, this.config.widgetOptions );
var widget = ts.getWidgetById( id );
if ( widget ) {
widget.format( this, this.config, this.config.widgetOptions );
}
})
.bind( 'applyWidgets' + namespace, function( e, init ) {
e.stopPropagation();
@ -1281,6 +1284,11 @@
// problems with element focus
ts.resortComplete( c, callback );
}
} else {
if ( c.debug ) {
console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
}
c.table.isUpdating = false;
}
},
@ -4109,6 +4117,11 @@
data.filter = ts.replaceAccents( data.filter );
}
// replace column specific default filters - see #1088
if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) {
data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] );
}
// data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ),
// data.filter = case sensitive
data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter;

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 12-01-2015 (v2.24.6)*/
/*! tablesorter (FORK) - updated 12-02-2015 (v2.24.6)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -1463,6 +1463,11 @@
data.filter = ts.replaceAccents( data.filter );
}
// replace column specific default filters - see #1088
if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) {
data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] );
}
// data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ),
// data.filter = case sensitive
data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter;

View File

@ -1089,6 +1089,11 @@
data.filter = ts.replaceAccents( data.filter );
}
// replace column specific default filters - see #1088
if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) {
data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] );
}
// data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ),
// data.filter = case sensitive
data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter;