Skip to content

Commit 8526471

Browse files
committed
Added ability to deselect all checkboxes in server-side mode
1 parent a435ba0 commit 8526471

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

js/dataTables.checkboxes.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,17 @@ Api.registerPlural( 'cells().checkboxes.deselect()', 'cell().checkboxes.deselect
877877
return this.checkboxes.select(false, allowDups);
878878
} );
879879

880+
Api.registerPlural( 'columns().checkboxes.deselectAll()', 'column().checkboxes.deselectAll()', function () {
881+
return this.iterator( 'column', function (ctx, colIdx){
882+
// If Checkboxes extension is enabled for this column
883+
if(ctx.aoColumns[colIdx].checkboxes){
884+
ctx.checkboxes.s.data[colIdx] = {};
885+
886+
this.column(colIdx).checkboxes.select(false, false);
887+
}
888+
}, 1 );
889+
} );
890+
880891
Api.registerPlural( 'columns().checkboxes.selected()', 'column().checkboxes.selected()', function () {
881892
return this.iterator( 'column', function (ctx, colIdx){
882893
if(ctx.aoColumns[colIdx].checkboxes){

0 commit comments

Comments
 (0)