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

"indeterminate" is not work #141

Closed atkuo090 closed 11 months ago

atkuo090 commented 2 years ago

image

Problem with Checkbox 1.2.12. DataTables 1.11.5: When I just select one item ,it still appear select-all

mpryvkin commented 2 years ago

Sorry, I cannot replicate it.

I updated a few examples (Basic Initialization, Styling - Awesome Bootstrap Checkbox) to 1.2.13 and they all work correctly in Firefox, Chrome and MS Edge.

If you could share an example demonstrating the problem based on one of the examples above, that would help to locate the issue. Thanks!

sadeghbarati commented 2 years ago

@mpryvkin

Update Solved:

https://j0t3p9.sse.codesandbox.io/

sadeghbarati commented 2 years ago

Sorry, I cannot replicate it.

I updated a few examples (Basic Initialization, Styling - Awesome Bootstrap Checkbox) to 1.2.13 and they all work correctly in Firefox, Chrome and MS Edge.

If you could share an example demonstrating the problem based on one of the examples above, that would help to locate the issue. Thanks!

Basic Initialization

'ajax': 'https://gyrocode.github.io/files/jquery-datatables/arrays_id.json',
//without columns

Modified Basic Initialization

'ajax': 'https://gyrocode.github.io/files/jquery-datatables/objects.json',

Solved

Known Limitations Column containing checkboxes must have unique data. Using columns.data option set to null for the column containing checkboxes will result in unexpected behavior. Selecting rows on all pages using columns.checkboxes.selectAllPages option in server-side processing mode is currently not possible. In this mode only rows on the current page are selected, when “select all” control is clicked.

I had read this before but I thought to make a checkbox column it must be made empty column with data: null so data and checkbox do not conflict

mpryvkin commented 11 months ago

The problem was with using objects as data and not using columns.data option to specify data to be used by column containing checkboxes.

The solution is to specify data using columns.data option, see jsfiddle.net/1as42f6t/.