aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/static/new/javascript/create_datatable.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/wqflask/wqflask/static/new/javascript/create_datatable.js b/wqflask/wqflask/static/new/javascript/create_datatable.js
index fc9530a5..2953655c 100644
--- a/wqflask/wqflask/static/new/javascript/create_datatable.js
+++ b/wqflask/wqflask/static/new/javascript/create_datatable.js
@@ -1,4 +1,4 @@
-create_table = function(tableId, tableData, columnDefs, customSettings) {
+create_table = function(tableId, tableData = [], columnDefs = [], customSettings = {}) {
loadDataTable(tableId=tableId, tableData=tableData, customSettings, firstRun=true)
@@ -23,7 +23,6 @@ create_table = function(tableId, tableData, columnDefs, customSettings) {
change_buttons()
});
},
- "data": tableData,
"columns": columnDefs,
"sDom": "iti",
"destroy": true,
@@ -49,6 +48,10 @@ create_table = function(tableId, tableData, columnDefs, customSettings) {
}
}
+ if (tableData.length > 0){
+ tableSettings["data"] = tableData
+ }
+
// Replace default settings with custom settings or add custom settings if not already set in default settings
$.each(customSettings, function(key, value) {
tableSettings[key] = value