Column Filtering w/Checkboxes
Column Filtering w/Checkboxes
Are there posted examples of using checkboxes to filter columns? And can these be positioned outside of the ? In other words, I have Event Types, which contain values such as: Sports, Concerts, Plays. I want to create a checkbox group, where a user can select 1->N checkboxes and have it filter the results. The checkboxes would be to the side of the results table. Any advice is appreciated. Thanks!
This discussion has been closed.
Replies
If you're using client side code, you can compose a reg ex filter of the checkbox values, pass it to fnFilter. see http://datatables.net/ref
[code]
var oTable;
$(document).ready(function() {
oTable = $('#example').dataTable();
/* example of Filter on oTable*/
oTable.fnFilter('sports|concerts', col_number, regexp = true );
} );
[/code]
if you're using server side processing, you can send special parameters to the server script and compose a WHERE clause using OR.
can you explain it better;
Thanks
in regular expression language, the "|" character means "OR", so the above filter looks for values that are either 'sports' OR 'concerts'.