ColumnfilterWidgets: Successfully set filters via JS, but cannot remove them...
ColumnfilterWidgets: Successfully set filters via JS, but cannot remove them...
Hi,
I have managed to set default-values for filters by running [code]"fnDrawCallback": function (oSettings) {
$("#myTable_wrapper .column-filter-widget:eq(1) option:contains('string')").attr('selected','selected').change();
}[/code], but unfortunately the user is not able to clear these filters: clicking on the term (as with manully selected terms) does not remove the term from the filter. I was hoping the JS would trigger the same actions as when a user clicks an item in the filter-dropdown, but somehow there is a difference....?
Thanks
Michael
I have managed to set default-values for filters by running [code]"fnDrawCallback": function (oSettings) {
$("#myTable_wrapper .column-filter-widget:eq(1) option:contains('string')").attr('selected','selected').change();
}[/code], but unfortunately the user is not able to clear these filters: clicking on the term (as with manully selected terms) does not remove the term from the filter. I was hoping the JS would trigger the same actions as when a user clicks an item in the filter-dropdown, but somehow there is a difference....?
Thanks
Michael
This discussion has been closed.
Replies
Hi mibaas,
I am trying to do exactly the same as you, prefilter the table on page load but still allow the user to deselect the applied filters. Using ColumnfilterIwdgets.
However, there are no "column-filter-widget" classes to be found in my table, and obviously your code doesn't work for me.
Which version of clumn filter widget do you use?
Thanks,
Nicolas
Well, got it to work after all, thanks for your excellent piece of code Michael! (i was simply referencing the wrong column)