Hi all.
I am a newbie in using ui table tabulator and ui control. I have data comes from sql (Hand size and Quantity), then based on the hand size I want to set different background color to the respective row. I did read on the tabulator and ui control articles, but haven't fully understand to apply on my flows.
Thank you
[
{
"id": "b7566cb0d0928290",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "415203cbeae93ab9",
"type": "function",
"z": "b7566cb0d0928290",
"name": "Select from DB",
"func": "\nmsg.payload = \"select [Hand Size], [Quantity] from [dbo].[Data] \";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 460,
"y": 420,
"wires": [
[
"ac18db9b37b7f3ac"
]
]
},
{
"id": "ac18db9b37b7f3ac",
"type": "MSSQL",
"z": "b7566cb0d0928290",
"mssqlCN": "df8c0b88.91b0a8",
"name": "MSSQL",
"outField": "payload",
"returnType": "0",
"throwErrors": "0",
"query": "",
"modeOpt": "",
"modeOptType": "query",
"queryOpt": "payload",
"queryOptType": "msg",
"paramsOpt": "queryParams",
"paramsOptType": "msg",
"rows": "",
"rowsType": "msg",
"params": [],
"x": 680,
"y": 420,
"wires": [
[
"5eb4d2f4131ebc68"
]
]
},
{
"id": "5eb4d2f4131ebc68",
"type": "function",
"z": "b7566cb0d0928290",
"name": "",
"func": "var key = Object.keys(msg.payload[0]);\nvar arr = [];\nvar col = [];\n\nfor(i = 0; i <key.length; i++){\n arr = {\n \"title\": key[i],\n \"field\": key[i],\n \"headerFilter\": \"input\"\n }\n col.push(arr)\n}\n\nmsg.ui_control = \n{\n \"tabulator\": {\n \"columns\": col\n }\n}\nreturn msg;\n\n\n\n\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 880,
"y": 420,
"wires": [
[
"8f5434908f35809c"
]
]
},
{
"id": "8f5434908f35809c",
"type": "ui_table",
"z": "b7566cb0d0928290",
"group": "13b35473.20565c",
"name": "Data",
"order": 1,
"width": "0",
"height": "0",
"columns": [
{
"field": "",
"title": "Hand Size",
"width": "",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "",
"title": "Quantity",
"width": "",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
}
],
"outputs": 0,
"cts": false,
"x": 1070,
"y": 420,
"wires": []
},
{
"id": "d4a00da03f7f4cc3",
"type": "inject",
"z": "b7566cb0d0928290",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 190,
"y": 420,
"wires": [
[
"415203cbeae93ab9"
]
]
},
{
"id": "df8c0b88.91b0a8",
"type": "MSSQL-CN",
"name": "Test",
"server": "",
"port": "",
"encyption": false,
"trustServerCertificate": false,
"database": "Test",
"useUTC": false,
"connectTimeout": "",
"requestTimeout": "",
"cancelTimeout": "",
"pool": "20",
"parseJSON": false,
"enableArithAbort": true,
"credentials": {}
},
{
"id": "13b35473.20565c",
"type": "ui_group",
"name": "Default",
"tab": "de4df751.046f08",
"order": 3,
"disp": false,
"width": "6",
"collapse": false
},
{
"id": "de4df751.046f08",
"type": "ui_tab",
"name": "Home",
"icon": "track_changes",
"order": 1,
"disabled": false,
"hidden": false
}
]