Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit 3c880cb

Browse files
committed
Correct changing columnDefs #329
1 parent 674012b commit 3c880cb

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

dist/angular-datatables.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,15 +1092,19 @@ function dtAjaxRenderer($q, $timeout, DTRenderer, DTRendererService, DT_DEFAULT_
10921092
}
10931093

10941094
function rerender() {
1095-
_oTable.destroy();
1096-
DTRendererService.showLoading(_$elem);
10971095
render(_$elem);
10981096
}
10991097

11001098
function _doRender(options, $elem) {
11011099
var defer = $q.defer();
1102-
// Set it to true in order to be able to redraw the dataTable
1100+
// Destroy the table if it exists in order to be able to redraw the dataTable
11031101
options.bDestroy = true;
1102+
if (_oTable) {
1103+
_oTable.destroy();
1104+
DTRendererService.showLoading(_$elem);
1105+
// Empty in case of columns change
1106+
$elem.empty();
1107+
}
11041108
DTRendererService.hideLoading($elem);
11051109
// Condition to refresh the dataTable
11061110
if (_shouldDeferRender(options)) {

0 commit comments

Comments
 (0)