0

In my jQuery datatable I use a column().search() searchbox for every column.

I have one column where each row contains a checkbox.

Now I want to filter the table to display only the rows where the checkbox is checked (or respectively unchecked).

Any ideas how to implement this, or pointers to examples?

6
  • I have used a "text" next to the checkbox with the state e.g. "Enabled" or "Disabled". This works, but looks a bit strange. Commented Aug 4, 2016 at 14:55
  • 1
    Please create a Minimal, Complete, and Verifiable Example Commented Aug 4, 2016 at 15:02
  • If you meant sorting the checkbox column for selected and un-selected items .If you already had a column definition for 'select-checkbox' ,update the property orderable: true. Please refer this example: datatables.net/extensions/select/examples/initialisation/… Commented Aug 4, 2016 at 16:02
  • Do you want solution as client side or server side? Commented Aug 4, 2016 at 16:05
  • Thanks Aditya, I am not using the select extension. The Checkbox is just a representation of a boolean value in the record. Commented Aug 4, 2016 at 16:07

1 Answer 1

0

I found an answer:

Use the render function to display the checkbox only if the type is "display" for "search" use the data.

References: https://datatables.net/manual/data/renderers#Data-rendering

Sign up to request clarification or add additional context in comments.

1 Comment

A little late but I am experiencing a similar issue: My Question. Anyway your solution can help me?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.