gyrocode / jquery-datatables-checkboxes

Checkboxes is an extension for the jQuery DataTables library that provides universal solution for working with checkboxes in a table.
https://www.gyrocode.com/projects/jquery-datatables-checkboxes/
MIT License
150 stars 61 forks source link

Get rows with checked checkbox in a given column #94

Open mrsnax opened 5 years ago

mrsnax commented 5 years ago

Hi,

I love this plugin in. Its the best plugin than original datatables select. My question is how to trying to get selected index of table row not data. It will be used for tr:eq(index?) within selectCallback. Please let me know.

Thank you

mpryvkin commented 5 years ago

Thanks for you kind words.

If you're using client side processing mode, you can use Select extension to retrieve selected rows, for example: var $tr = table.rows( { selected: true } ).nodes().to$(), see Get selected items.

If you're using server-side processing mode, currently there is no easy way to do it. As a workaround you can retrieve selected data with column().checkboxes.selected() API method and then enumerate all rows with [rows().every()](https://datatables.net/reference/api/rows().every()) and compare the selected data with row data. If it matches you can retrieve row's node.

I will need to come up with a new API method to get rows with checked checkbox in a given column or columns.

sandeepbalagopal09 commented 3 years ago

is this feature implemented ?

mpryvkin commented 3 years ago

@sandeepbalagopal09 unfortunately, it hasn't been implemented. The only way is to use the workaround suggested in my original reply.