How to filter DataTable using a checkbox.
How to filter DataTable using a checkbox.
I've been through multiple forum questions and documentation, but am still stuck. I would like a simple checkbox above the DataTable that allows the user to select when wanting to filter based on a single column value. For example, only display the records in the DataTable where the Shipped column is equal to "NO". I can get the checkbox to display, but cannot figure out how to cause the filtering to occur when the checkbox is checked. Has anyone accomplished this scenario? -Thx.
Answers
Do you want the filtering to happen on the client-side without a data reload? Or an Ajax reload to requery an SQL server? Are you using client-side or server-side processing?
Allan
Hi Allan,
Right now I'm using client-side, but will eventually re-code for server-side processing. Filtering without a data reload may be the solution for now.
Thank you.
With client-side processing you can use
search()
orcolumn().search()
as the built in string searching solutions. If you need something more complex you can create a custom search plug-in.Allan