From 4164f34fa499bc94a3a5a938701d090c6ec695af Mon Sep 17 00:00:00 2001 From: Ivan Filippov Date: Tue, 26 Apr 2016 18:51:06 -0600 Subject: [PATCH] Add 'getDataTable' function from old template. --- app/static/custom/js/custom.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/static/custom/js/custom.js b/app/static/custom/js/custom.js index 974c7ca..da28233 100644 --- a/app/static/custom/js/custom.js +++ b/app/static/custom/js/custom.js @@ -24,4 +24,22 @@ function applyChanges(data, url, showResult) { } }); +} + +function getTableData(table) { + var rData = [] + + // reformat - pretty format + var records = [] + table.rows().every(function() { + var r = this.data(); + var record = {} + record["record_name"] = r[0].trim(); + record["record_type"] = r[1].trim(); + record["record_status"] = r[2].trim(); + record["record_ttl"] = r[3].trim(); + record["record_data"] = r[4].trim(); + records.push(record); + }); + return records } \ No newline at end of file