diff --git a/preview/a-good-table/main.js b/preview/a-good-table/main.js index 7dc277b..f39033d 100644 --- a/preview/a-good-table/main.js +++ b/preview/a-good-table/main.js @@ -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(); },