Reputation: 641
How can I apply a non interactive default filter to Tablefilter?
Something like show rows where field_1="variable"
but stablished by default when the table is loaded.
Thanks!
Upvotes: 0
Views: 1674
Reputation: 4475
As of 2.10.8, another solution would be to add the desired filter to the header column's data-value
attribute (as answered here.)
<table id="table">
<thead>
<tr>
<th>...</th>
...
<th data-value="abc">...</th>
</thead>
<tbody>
...
</tbody>
</table>
More information and a sample can be found on the Custom Filter Widget Functions demo.
Upvotes: 0
Reputation: 86403
If I understand what you are asking, you can set the header class to "filter-false"
to disable the filter in that column; then set the desired filters after the table initializes (demo):
$('table').tablesorter({
theme: 'blackice',
widgets: ['zebra', 'filter'],
initialized: function (table) {
$.tablesorter.setFilters( table, ['abc'], true);
}
});
Upvotes: 3