Skip to content

Commit 10a594a

Browse files
committed
Reduce memory footprint after table is destroyed
Needed only in case user saves instance of DataTable object.
1 parent b48f5e2 commit 10a594a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

js/dataTables.checkboxes.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Checkboxes.prototype = {
231231

232232
// Update the table information element with selected item summary
233233
//
234-
// NOTE: Needed to display correct count of selected rows
234+
// NOTE: Needed to display correct count of selected rows
235235
// when using server-side processing mode
236236
$table.on('draw.dt.dtCheckboxes select.dt.dtCheckboxes deselect.dt.dtCheckboxes', function(){
237237
self.showInfoSelected();
@@ -312,8 +312,13 @@ Checkboxes.prototype = {
312312
$tableBody.off('.dtCheckboxes');
313313
$table.off('.dtCheckboxes');
314314

315-
// Remove added elements
315+
// Clear data
316+
//
317+
// NOTE: Needed only to reduce memory footprint
318+
// in case user saves instance of DataTable object.
319+
self.s.data = {};
316320

321+
// Remove added elements
317322
$('.dt-checkboxes-select-all', $table).each(function(index, el){
318323
$(el)
319324
.html($(el).data('html'))

0 commit comments

Comments
 (0)