@@ -629,7 +629,7 @@ Checkboxes.prototype = {
629
629
630
630
// Indicate that state of "Select all" control has been changed
631
631
$ ( ctrl ) . data ( 'is-changed' , true ) ;
632
-
632
+
633
633
dt . column ( colIdx , {
634
634
page : (
635
635
( ctx . aoColumns [ colIdx ] . checkboxes && ctx . aoColumns [ colIdx ] . checkboxes . selectAllPages )
@@ -685,9 +685,17 @@ Checkboxes.prototype = {
685
685
var $checkboxesSelectAll = $ ( '.dt-checkboxes-select-all[data-col="' + colIdx + '"] input[type="checkbox"]' , $tableContainer ) ;
686
686
687
687
var countChecked = 0 ;
688
+ var countDisabled = 0 ;
688
689
var cellsData = cells . data ( ) ;
689
690
$ . each ( cellsData , function ( index , cellData ) {
690
- if ( self . s . data [ colIdx ] . hasOwnProperty ( cellData ) ) { countChecked ++ ; }
691
+ // If checkbox is not disabled
692
+ if ( self . isCellSelectable ( colIdx , cellData ) ) {
693
+ if ( self . s . data [ colIdx ] . hasOwnProperty ( cellData ) ) { countChecked ++ ; }
694
+
695
+ // Otherwise, if checkbox is disabled
696
+ } else {
697
+ countDisabled ++ ;
698
+ }
691
699
} ) ;
692
700
693
701
// If FixedHeader is enabled in this instance
@@ -702,12 +710,12 @@ Checkboxes.prototype = {
702
710
var isIndeterminate ;
703
711
704
712
// If none of the checkboxes are checked
705
- if ( countChecked === 0 ) {
713
+ if ( countChecked === 0 ) {
706
714
isSelected = false ;
707
715
isIndeterminate = false ;
708
716
709
717
// If all of the checkboxes are checked
710
- } else if ( countChecked === cellsData . length ) {
718
+ } else if ( ( countChecked + countDisabled ) === cellsData . length ) {
711
719
isSelected = true ;
712
720
isIndeterminate = false ;
713
721
0 commit comments