Skip to content

Commit 252b210

Browse files
committed
Minor fixes
1 parent 1c48b04 commit 252b210

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

js/dataTables.checkboxes.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,10 @@ Checkboxes.prototype = {
509509
// Get cell data
510510
var cellData = this.data();
511511

512-
// Determine if checkbox in the cell can be checked
512+
// Determine if checkbox in the cell can be selected
513513
var isCellSelectable = self.isCellSelectable(colIdx, cellData);
514514

515-
// If checkbox is selected
515+
// If checkbox is checked
516516
if(ctx.checkboxes.s.data[colIdx].hasOwnProperty(cellData)){
517517
self.updateCheckbox(this, colIdx, true);
518518

@@ -919,7 +919,8 @@ Api.registerPlural( 'columns().checkboxes.select()', 'column().checkboxes.select
919919
if(typeof state === 'undefined'){ state = true; }
920920

921921
return this.iterator( 'column-rows', function ( ctx, colIdx, i, j, rowsIdx ) {
922-
if(ctx.checkboxes){
922+
// If Checkboxes extension is enabled for this column
923+
if(ctx.aoColumns[colIdx].checkboxes){
923924
// Prepare a list of all cells
924925
var selector = [];
925926
$.each(rowsIdx, function(index, rowIdx){
@@ -933,7 +934,7 @@ Api.registerPlural( 'columns().checkboxes.select()', 'column().checkboxes.select
933934
var rowsSelectableIdx = [];
934935
selector = [];
935936
$.each(cellsData, function(index, cellData){
936-
// If checkbox in the cell can be checked
937+
// If checkbox in the cell can be selected
937938
if(ctx.checkboxes.isCellSelectable(colIdx, cellData)){
938939
selector.push({ row: rowsIdx[index], column: colIdx });
939940
rowsSelectableIdx.push(rowsIdx[index]);
@@ -969,11 +970,12 @@ Api.registerPlural( 'cells().checkboxes.select()', 'cell().checkboxes.select()',
969970
if(typeof state === 'undefined'){ state = true; }
970971

971972
return this.iterator( 'cell', function ( ctx, rowIdx, colIdx ) {
972-
if(ctx.checkboxes){
973+
// If Checkboxes extension is enabled for this column
974+
if(ctx.aoColumns[colIdx].checkboxes){
973975
var cells = this.cells([{ row: rowIdx, column: colIdx }]);
974976
var cellData = this.cell({ row: rowIdx, column: colIdx }).data();
975977

976-
// If checkbox in the cell can be checked
978+
// If checkbox in the cell can be selected
977979
if(ctx.checkboxes.isCellSelectable(colIdx, cellData)){
978980
ctx.checkboxes.updateData(cells, colIdx, state);
979981
ctx.checkboxes.updateCheckbox(cells, colIdx, state);
@@ -1003,7 +1005,8 @@ Api.registerPlural( 'cells().checkboxes.enable()', 'cell().checkboxes.enable()',
10031005
if(typeof state === 'undefined'){ state = true; }
10041006

10051007
return this.iterator( 'cell', function ( ctx, rowIdx, colIdx ) {
1006-
if(ctx.checkboxes){
1008+
// If Checkboxes extension is enabled for this column
1009+
if(ctx.aoColumns[colIdx].checkboxes){
10071010
var cell = this.cell({ row: rowIdx, column: colIdx });
10081011

10091012
// Get cell data

0 commit comments

Comments
 (0)