How to filter DataTable using a checkbox.

How to filter DataTable using a checkbox.

boicenetboicenet Posts: 47Questions: 12Answers: 1

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

  • allanallan Posts: 63,836Questions: 1Answers: 10,518 Site admin

    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

  • boicenetboicenet Posts: 47Questions: 12Answers: 1

    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.

  • allanallan Posts: 63,836Questions: 1Answers: 10,518 Site admin

    With client-side processing you can use search() or column().search() as the built in string searching solutions. If you need something more complex you can create a custom search plug-in.

    Allan

This discussion has been closed.