diff --git a/docs/index.html b/docs/index.html index 50b17cd0..e2ec44e7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1850,10 +1850,12 @@ $(function(){
"tablesorter-filter"
class will always be added to the filter; this option now contains any additional class names to add.
Use the "tablesorter-filter"
option to add an extra css class name as follows:
$(function(){ @@ -1861,6 +1863,7 @@ $(function(){ widgets: ["filter"], widgetOptions : { // css class applied to the table row containing the filters & the inputs within that row + // or [ "filter1", "filter2", "filter3", etc... ] filter_cssFilter : "tablesorter-filter" } }); diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index e307a5bc..c30548fd 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -653,7 +653,7 @@ ts.filter = { return filters; }, buildRow: function(table, c, wo) { - var column, $header, buildSelect, disabled, + var column, $header, buildSelect, disabled, name, // c.columns defined in computeThIndexes() columns = c.columns, buildFilter = ''; @@ -699,7 +699,11 @@ ts.filter = { } } if (buildFilter) { - buildFilter.addClass('tablesorter-filter ' + wo.filter_cssFilter).attr('data-column', column); + // add filter class name + name = ( $.isArray(wo.filter_cssFilter) ? + (typeof wo.filter_cssFilter[column] !== 'undefined' ? wo.filter_cssFilter[column] || '' : '') : + wo.filter_cssFilter ) || ''; + buildFilter.addClass('tablesorter-filter ' + name).attr('data-column', column); if (disabled) { buildFilter.addClass('disabled')[0].disabled = true; // disabled! }