hi . i have a project which select some data's from nodes , and show them in table at dashboard, now I want add select bar to each row at table to delete or edit or send it to DB, how i can do them ?
[
{
"id": "36348c32365b6b66",
"type": "tab",
"label": "bridge lighting",
"disabled": false,
"info": "",
"env": []
},
{
"id": "152bce1c24dfcab7",
"type": "ui_dropdown",
"z": "36348c32365b6b66",
"name": "",
"label": "انتخاب سال ",
"tooltip": "",
"place": "Select option",
"group": "6305d8128da6cbab",
"order": 1,
"width": "9",
"height": "1",
"passthru": true,
"multiple": false,
"options": [
{
"label": "1402",
"value": "1402",
"type": "str"
},
{
"label": "1403",
"value": "1403",
"type": "str"
},
{
"label": "1404",
"value": "1404",
"type": "str"
},
{
"label": "1405",
"value": "1405",
"type": "str"
},
{
"label": "1406",
"value": "1406",
"type": "str"
},
{
"label": "1407",
"value": "1407",
"type": "str"
},
{
"label": "1408",
"value": "1408",
"type": "str"
},
{
"label": "1409",
"value": "1409",
"type": "str"
},
{
"label": "1410",
"value": "1410",
"type": "str"
}
],
"payload": "",
"topic": "year",
"topicType": "str",
"className": "",
"x": 660,
"y": 160,
"wires": [
[
"81363a2d27fbc7c3"
]
]
},
{
"id": "f82d933954275f0d",
"type": "ui_dropdown",
"z": "36348c32365b6b66",
"name": "",
"label": "انتخاب ماه ",
"tooltip": "",
"place": "Select option",
"group": "6305d8128da6cbab",
"order": 2,
"width": "9",
"height": 1,
"passthru": true,
"multiple": false,
"options": [
{
"label": "فروردین ",
"value": "1",
"type": "str"
},
{
"label": "اردیبهشت ",
"value": "2",
"type": "str"
},
{
"label": "خرداد",
"value": "3",
"type": "str"
},
{
"label": "تیر ",
"value": "4",
"type": "str"
},
{
"label": "مرداد",
"value": "5",
"type": "str"
},
{
"label": "شهریور",
"value": "6",
"type": "str"
},
{
"label": "مهر",
"value": "7",
"type": "str"
},
{
"label": "آبان ",
"value": "8",
"type": "str"
},
{
"label": "آذر",
"value": "9",
"type": "str"
},
{
"label": " دی ",
"value": "10",
"type": "str"
},
{
"label": "بهمن ",
"value": "11",
"type": "str"
},
{
"label": "اسفند ",
"value": "12",
"type": "str"
}
],
"payload": "",
"topic": "month",
"topicType": "str",
"className": "",
"x": 660,
"y": 220,
"wires": [
[
"81363a2d27fbc7c3"
]
]
},
{
"id": "9d3aed3a25d93d3f",
"type": "ui_dropdown",
"z": "36348c32365b6b66",
"name": "",
"label": "انتخاب روز از ماه",
"tooltip": "",
"place": "Select option",
"group": "6305d8128da6cbab",
"order": 3,
"width": "9",
"height": 1,
"passthru": true,
"multiple": false,
"options": [
{
"label": "",
"value": "1",
"type": "str"
},
{
"label": "",
"value": "2",
"type": "str"
},
{
"label": "",
"value": "3",
"type": "str"
},
{
"label": "",
"value": "4",
"type": "str"
},
{
"label": "",
"value": "5",
"type": "str"
},
{
"label": "",
"value": "6",
"type": "str"
},
{
"label": "",
"value": "7",
"type": "str"
},
{
"label": "",
"value": "8",
"type": "str"
},
{
"label": "",
"value": "9",
"type": "str"
},
{
"label": "",
"value": "10",
"type": "str"
},
{
"label": "",
"value": "11",
"type": "str"
},
{
"label": "",
"value": "12",
"type": "str"
},
{
"label": "",
"value": "13",
"type": "str"
},
{
"label": "",
"value": "14",
"type": "str"
},
{
"label": "",
"value": "15",
"type": "str"
},
{
"label": "",
"value": "16",
"type": "str"
},
{
"label": "",
"value": "17",
"type": "str"
},
{
"label": "",
"value": "18",
"type": "str"
},
{
"label": "",
"value": "19",
"type": "str"
},
{
"label": "",
"value": "20",
"type": "str"
},
{
"label": "",
"value": "21",
"type": "str"
},
{
"label": "",
"value": "22",
"type": "str"
},
{
"label": "",
"value": "23",
"type": "str"
},
{
"label": "",
"value": "24",
"type": "str"
},
{
"label": "",
"value": "25",
"type": "str"
},
{
"label": "",
"value": "26",
"type": "str"
},
{
"label": "",
"value": "27",
"type": "str"
},
{
"label": "",
"value": "28",
"type": "str"
},
{
"label": "",
"value": "29",
"type": "str"
},
{
"label": "",
"value": "30",
"type": "str"
},
{
"label": "",
"value": "31",
"type": "str"
}
],
"payload": "",
"topic": "day",
"topicType": "str",
"className": "",
"x": 680,
"y": 260,
"wires": [
[
"81363a2d27fbc7c3"
]
]
},
{
"id": "b952f36f30a14385",
"type": "ui_form",
"z": "36348c32365b6b66",
"name": "Schedule Form",
"label": "",
"group": "6305d8128da6cbab",
"order": 4,
"width": "9",
"height": "2",
"options": [
{
"label": "Start Time (HH:MM)",
"value": "startTime",
"type": "text",
"required": true,
"rows": null
},
{
"label": "Finish Time (HH:MM)",
"value": "finishTime",
"type": "text",
"required": true,
"rows": null
}
],
"formValue": {
"startTime": "",
"finishTime": ""
},
"payload": "{}",
"submit": "submit",
"cancel": "",
"topic": "time",
"topicType": "str",
"splitLayout": false,
"className": "",
"x": 680,
"y": 300,
"wires": [
[
"81363a2d27fbc7c3"
]
]
},
{
"id": "0122d72eabb1d981",
"type": "ui_table",
"z": "36348c32365b6b66",
"group": "6305d8128da6cbab",
"name": "زمانبندی ",
"order": 6,
"width": "7",
"height": "5",
"columns": [
{
"field": "yearData",
"title": "yearData",
"width": "",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "monthData",
"title": "monthData",
"width": "",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "dayData",
"title": "روز",
"width": "",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "timeStartData",
"title": "ساعت شروع",
"width": "",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "timeFinishData",
"title": "ساعت پایان ",
"width": "",
"align": "left",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "effectData",
"title": "افکت",
"width": "",
"align": "left",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
}
],
"outputs": 1,
"cts": true,
"x": 1270,
"y": 240,
"wires": [
[
"99aa178ef64a181f"
]
]
},
{
"id": "81363a2d27fbc7c3",
"type": "function",
"z": "36348c32365b6b66",
"name": "Format for Table",
"func": "var yearData = flow.get(\"yearData\") || [];\nvar monthData = flow.get(\"monthData\") || [];\nvar dayData = flow.get(\"dayData\") || [];\nvar timeStartData = flow.get(\"timeStartData\") || [];\nvar timeFinishData = flow.get(\"timeFinishData\") || [];\nvar effectData = flow.get(\"effectData\") || [];\n\nswitch (msg.topic) {\n case \"year\":\n yearData.push(msg.payload);\n flow.set(\"yearData\", yearData);\n break;\n case \"month\":\n monthData.push(msg.payload);\n flow.set(\"monthData\", monthData);\n break;\n case \"day\":\n dayData.push(msg.payload);\n flow.set(\"dayData\", dayData);\n break;\n case \"time\":\n if (msg.payload.hasOwnProperty(\"startTime\") && msg.payload.hasOwnProperty(\"finishTime\")) {\n timeStartData.push(msg.payload.startTime);\n timeFinishData.push(msg.payload.finishTime);\n flow.set(\"timeStartData\", timeStartData);\n flow.set(\"timeFinishData\", timeFinishData);\n }\n break;\n case \"effect\":\n effectData.push(msg.payload);\n flow.set(\"effectData\", effectData);\n break;\n}\n\nvar tableData = [];\n\nfor (var i = 0; i < Math.max(yearData.length, monthData.length, dayData.length, timeStartData.length, timeFinishData.length, effectData.length); i++) {\n var row = {\n 'yearData': yearData[i] || \"\",\n 'monthData': monthData[i] || \"\",\n 'dayData': dayData[i] || \"\",\n 'timeStartData': timeStartData[i] || \"\",\n 'timeFinishData': timeFinishData[i] || \"\",\n 'effectData': effectData[i] || \"\"\n };\n tableData.push(row);\n}\n\nreturn { payload: tableData };\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1100,
"y": 240,
"wires": [
[
"0122d72eabb1d981"
]
]
},
{
"id": "99aa178ef64a181f",
"type": "debug",
"z": "36348c32365b6b66",
"name": "debug 8",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1420,
"y": 240,
"wires": []
},
{
"id": "e94ecbf3784daf18",
"type": "ui_button",
"z": "36348c32365b6b66",
"name": "edit",
"group": "6305d8128da6cbab",
"order": 9,
"width": "2",
"height": "1",
"passthru": false,
"label": "edit",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "edit",
"payload": "edit",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 670,
"y": 460,
"wires": [
[]
]
},
{
"id": "3bbb7dec5e635afb",
"type": "ui_button",
"z": "36348c32365b6b66",
"name": "send",
"group": "6305d8128da6cbab",
"order": 8,
"width": "2",
"height": "1",
"passthru": false,
"label": "send",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "send",
"payload": "send",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 670,
"y": 420,
"wires": [
[]
]
},
{
"id": "3e440484554451cb",
"type": "ui_button",
"z": "36348c32365b6b66",
"name": "delete",
"group": "6305d8128da6cbab",
"order": 7,
"width": "2",
"height": "1",
"passthru": false,
"label": "delete",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "delete",
"payload": "delete",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 670,
"y": 500,
"wires": [
[]
]
},
{
"id": "4636da6271a079aa",
"type": "ui_dropdown",
"z": "36348c32365b6b66",
"name": "",
"label": "انتخاب افکت ",
"tooltip": "",
"place": "Select option",
"group": "6305d8128da6cbab",
"order": 5,
"width": "9",
"height": 1,
"passthru": true,
"multiple": true,
"options": [
{
"label": "افکت اول",
"value": "A",
"type": "str"
},
{
"label": "افکت دوم",
"value": "B",
"type": "str"
},
{
"label": "افکت سوم",
"value": "C",
"type": "str"
},
{
"label": "افکت چهارم",
"value": "D",
"type": "str"
},
{
"label": "افکت پنجم",
"value": "E",
"type": "str"
},
{
"label": "افکت ششم",
"value": "F",
"type": "str"
}
],
"payload": "",
"topic": "effect",
"topicType": "str",
"className": "",
"x": 660,
"y": 340,
"wires": [
[
"81363a2d27fbc7c3"
]
]
},
{
"id": "6305d8128da6cbab",
"type": "ui_group",
"name": "Group 1",
"tab": "b927390ff1bafb51",
"order": 1,
"disp": true,
"width": 17
},
{
"id": "b927390ff1bafb51",
"type": "ui_tab",
"name": "bridge",
"icon": "dashboard",
"order": 20,
"disabled": false,
"hidden": false
}
]