Skip to content

Commit

Permalink
[fix]: table cache clear and redraw
Browse files Browse the repository at this point in the history
  • Loading branch information
hongkuiw committed Oct 24, 2021
1 parent 3e85bfc commit 682ce32
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions preview/a-good-table/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,18 +620,23 @@ const visObject = {

var dataRows = generateHighChartsDataSeries(dataRecords);

var table = $("#container").DataTable({
data: dataRows,
columns: columnsDataTable,
searching: true,
// fixedHeader: false,
select: true,
colReorder: true,
responsive: true,
mark: true,
});
function updateDataTable(dataRows) {
var table = $("#container").DataTable({
data: dataRows,
columns: columnsDataTable,
searching: true,
// fixedHeader: false,
select: true,
colReorder: true,
responsive: true,
mark: true,
})
table.clear()
table.rows.add(dataRows)
table.draw()
}

table.draw()
updateDataTable(dataRows)

done();
},
Expand Down

0 comments on commit 682ce32

Please sign in to comment.