You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my app i have a column that can have digits 1-10 (including decimals), or the string 'All'. I am able to sort these columns with the following code:
$("table").tablesorter({ textSorter: { 1: function(a, b) { x = parseFloat(a); y = parseFloat(b); return x === 0 && y === 0 ? b.length - a.length : $.tablesorter.sortNatural(a, b); } }, });
... i was wondering if the same can be applied to filtering? I am using the filter widget and whilst it works as it should, would like the filtering to always include rows with 'All' in the results? So when the dropdown is populated with the values from the table, say the user selects 3, all rows containing 3 and All are filtered. This should only happen on this column, other columns that are filterable(?) should not have this behaviour.
The text was updated successfully, but these errors were encountered:
Again, thanks for the quick reply. Your interpretation of the issue is spot on, and although the fiddle shows exactly what i am looking to achieve, it isn't working on my site. On mine (i should have stated), i am not using an input to filter the results, but the select (dropdown) box - that is the only difference between them.
In my app i have a column that can have digits 1-10 (including decimals), or the string 'All'. I am able to sort these columns with the following code:
$("table").tablesorter({ textSorter: { 1: function(a, b) { x = parseFloat(a); y = parseFloat(b); return x === 0 && y === 0 ? b.length - a.length : $.tablesorter.sortNatural(a, b); } }, });
... i was wondering if the same can be applied to filtering? I am using the filter widget and whilst it works as it should, would like the filtering to always include rows with 'All' in the results? So when the dropdown is populated with the values from the table, say the user selects 3, all rows containing 3 and All are filtered. This should only happen on this column, other columns that are filterable(?) should not have this behaviour.
The text was updated successfully, but these errors were encountered: