-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Description
I have a demo of the 'Indeterminate' checkbox in the top-left being buggy in this demo: https://codepen.io/joel-sweetman/pen/GRZMqjY
- The first example is a dataTable initalised through an existing table (this is where the buggy indeterminate checkbox state occurs).
- The second is through JSON data passed into it (the indeterminate state here works as expected).
I'm about to do a fork and investigate further, but I believe the issue is occurring here in the code:
$.each(cellsData, function(index, cellData){
// If checkbox is not disabled
if(self.isCellSelectable(colIdx, cellData)){
if(
Object.prototype.hasOwnProperty.call(self.s.data, colIdx)
&& Object.prototype.hasOwnProperty.call(self.s.data[colIdx], cellData)
) {
countChecked++;
}
// Otherwise, if checkbox is disabled
} else {
countDisabled++;
}
});
It looks like countChecked
is not counting correctly in the first demo, which will cause the indeterminate checkbox state for selectAll to not be toggled.
Metadata
Metadata
Assignees
Labels
No labels