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

RowsCount even if selectRow is false #105

Closed swim89 closed 4 years ago

swim89 commented 4 years ago

If the value of selectRow is false and you click on the row (but don't check it) the rowsCount add/remove element on the footer.

mpryvkin commented 4 years ago

This is correct behavior, see this example.

If you set selectRow: false , footer counter shows number of selected rows, and not number of rows with checked boxes.

swim89 commented 4 years ago

Thank you for your answer! Is there any way to disable RowsCount if the checkbox is not checked?

mpryvkin commented 4 years ago

Yes, you can use [select.info()](https://datatables.net/reference/api/select.info()) Select extension API method to disable info about selected rows. See this example.

But it doesn't make sense to me why would you want to hide number of selected rows and keep the ability to select rows.

swim89 commented 4 years ago

I want to select the rows by checking the checkbox not clicking on the row. This is my sense..

mpryvkin commented 4 years ago

Best solution to prevent row selection by clicking on the row is to limit selection to the column containing checkboxes by using select.selector option.

'select': {
   'style': 'multi',
   'selector': 'td:first-child'
},

See this example for code and demonstration.

You can combine it with using select.info() API method to disable info about selected rows if you want.