gyrocode/jquery-datatables-checkboxes

How to get selected rows after filtering?

will-emmerson opened this issue · 5 comments

How can I get the selected rows after filtering e.g. by searching? Using table.column(0).checkboxes.selected() gives me rows including those which are filtered out.

You need to use second argument for columns() API method to specify that you want to apply the filtering. For example: table.column(0, { search: 'applied'}).checkboxes.selected().

This isn't working for some reason, it's still counting all the rows. Doing table.rows({filter: 'applied'}) does return the right amount of rows but I'm not sure how to get filtered and selected rows.

You're right. For some reason I thought this was already implemented. Let me see what needs to be done about it.

You can now use { search: 'applied' } to get data for selected checkboxes with filtering applied.

For example:

var rows_selected = table.column(0, { search: 'applied' }).checkboxes.selected();

I'm afraid this is not working for me at all. I'm using the SelectRow functionality but tried it with simple initialization but no luck :-(