summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/index.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/client/index.js b/client/index.js
index bc57f548..2ee12c14 100644
--- a/client/index.js
+++ b/client/index.js
@@ -23,23 +23,24 @@ function appendTabulator(el, payload) {
height: '311px',
layout: 'fitColumns',
placeholder: 'No Data Set',
- columns: [
- // {title:'Name', field:'name', sorter:'string', width:200},
- // {title:'Progress', field:'progress', sorter:'number', formatter:'progress'},
- // {title:'Gender', field:'gender', sorter:"string"},
- // {title:"Rating", field:"rating", formatter:"star", align:"center", width:100},
- // {title:"Favourite Color", field:"col", sorter:"string", sortable:false},
- // {title:"Date Of Birth", field:"dob", sorter:"date", align:"center"},
- // {title:"Driver", field:"car", align:"center", formatter:"tickCross", sorter:"boolean"},
- ],
+ columns: payload.fields.split(', ').map(field => {
+ switch (field) {
+ default:
+ return { title: field, field: field.toLowerCase(), sorter: 'string' }
+ }
+ }),
+ // {title:'Name', field:'name', sorter:'string', width:200},
+ // {title:'Progress', field:'progress', sorter:'number', formatter:'progress'},
+ // {title:'Gender', field:'gender', sorter:"string"},
+ // {title:"Rating", field:"rating", formatter:"star", align:"center", width:100},
+ // {title:"Favourite Color", field:"col", sorter:"string", sortable:false},
+ // {title:"Date Of Birth", field:"dob", sorter:"date", align:"center"},
+ // {title:"Driver", field:"car", align:"center", formatter:"tickCross", sorter:"boolean"},
})
let path = payload.opt
let columns = payload.fields.split(',').map(s => s.trim())
- console.log(columns)
- if (path[0] !== '/') {
- console.log(path)
- }
- // table.setData(path)
+ console.log(path, columns)
+ table.setData(path)
}
function appendApplets() {