Hi madhouse!
Thanks for your feedback! It is good to know that using tabulator directly in a template node works.
At the current stage of the project I am less inclined to change. In the next sub-project I am considering this option. Is it possible to use any version of tabulator in such a setup (the later version have great imrovements in terms of data manipulation and checking)? Are you willing to share an example flow of how to integrate tabulator into a template node?
As for the problem at hand I found out that the ui-table handler accepts a msg.ui_control in which a full new table setup can be passed, which is used for the current message processing. One needs to remember to reuse that updated table setup in all following messages.
So I basically keep updating the ui_control with the new dropdown selection items. For me this works as this needs to be updated seldom.
[{"id":"c875aa3.cc01b58","type":"function","z":"df22847e.c06768","name":"update selection lists","func":"// check also the OnStart tab! It sets the basic configuration\nvar newMsg = {};\n\n// command for ui-table handler\nnewMsg.command = \"refreshTable\";\nnewMsg.argument = \"\";\n\nlet ui_control = flow.get(\"tableUIcontrol\");\nif(ui_control){\n // Finding index of the car with column \"program\" \n const searchIndex = ui_control.tabulator.columns.findIndex((column) => column.field==\"program\");\n \n // Update the value list for the respective column\n // ui_control.tabulator.columns[searchIndex].editorParams.values = flow.get(\"listValues\"); //alternative\n ui_control.tabulator.columns[searchIndex].editorParams.values = [\"my\",\"new\",\"list\",\"values\"];\n \n // save for later reuse\n flow.set(\"tableUIcontrol\",ui_control);\n newMsg.ui_control = ui_control;\n}\n\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\nflow.set(\"tableUIcontrol\",{\n \"customHeight\": 18,\n \"tabulator\": {\n \"index\": \"id\",\n \"layout\": \"fitColumns\",\n \"movableColumns\": true,\n \"autoColumns\": true,\n \"columns\": [\n {\n \"title\": \"pos\",\n \"field\": \"id\",\n \"headerSort\": false,\n \"width\": 55\n },\n {\n \"title\": \"min\",\n \"field\": \"min\",\n \"headerSort\": false,\n \"editor\": \"number\",\n \"editorParams\": {\n \"min\": 0,\n \"max\": 359,\n \"step\": 1\n },\n \"width\": 70\n },\n {\n \"title\": \"max\",\n \"field\": \"max\",\n \"headerSort\": false,\n \"editor\": \"number\",\n \"editorParams\": {\n \"min\": 0,\n \"max\": 359,\n \"step\": 1\n },\n \"width\": 70\n },\n {\n \"title\": \"Programm\",\n \"field\": \"program\",\n \"headerSort\": false,\n \"editor\": \"autocomplete\",\n \"editorParams\": {\n \"freetext\": false,\n \"allowEmpty\": false,\n \"showListOnEmpty\": true,\n \"values\": [\n \"red\",\n \"green\",\n \"blue\",\n \"orange\"\n ]\n }\n },\n {\n \"title\": \"Kontext 1\",\n \"field\": \"context1\",\n \"headerSort\": false,\n \"editor\": \"autocomplete\",\n \"editorParams\": {\n \"showListOnEmpty\": true,\n \"values\":[\"\"]\n }\n },\n {\n \"field\": \"up\",\n \"formatter\": \"function(cell, formatterParams, onRendered){ var html=\\\"<i class=\\\\\\\"fa fa-arrow-up\\\\\\\"></i>\\\"; return html; }\",\n \"headerSort\": false,\n \"width\": 10,\n \"align\": \"center\"\n },\n {\n \"field\": \"down\",\n \"formatter\": \"function(cell, formatterParams, onRendered){ var html=\\\"<i class=\\\\\\\"fa fa-arrow-down\\\\\\\"></i>\\\"; return html; }\",\n \"headerSort\": false,\n \"width\": 10,\n \"align\": \"center\"\n }\n ],\n \"cellEdited\": \"function (cell) { this.send( { ui_control: {callback:'cellEdited'}, payload: cell.getValue(), oldValue: cell.getOldValue(), field: cell.getColumn().getField(), id: cell.getRow().getCell('id').getValue() }); }\",\n \"columnResized\": \"function(column){ var newColumn = { field: column._column.field, visible: column._column.visible, width: column._column.width, widthFixed: column._column.widthFixed, widthStyled: column._column.widthStyled }; this.send({topic:this.config.topic,ui_control:{callback:'columnResized',columnWidths:newColumn}}); }\",\n \"columnMoved\": \"function(column, columns){ var newColumns=[]; columns.forEach(function (column) { newColumns.push({'field': column._column.definition.field, 'title': column._column.definition.title}); }); this.send({topic:this.config.topic,ui_control:{callback:'columnMoved',columns:newColumns}}); }\",\n \"rowMoved\": \"function(row){ var rowOrder=[]; row._row.parent.rows.forEach((row,index) => { rowOrder.push(row.data.id); }); this.send({ui_control:{\\\"callback\\\":'rowMoved',\\\"rowOrder\\\":rowOrder}}); }\"\n }\n})","finalize":"","libs":[],"x":280,"y":1600,"wires":[["ebc51e96.75e7f","a32d36c8.69d0c8"]]},{"id":"40b94c5b.75ed44","type":"inject","z":"df22847e.c06768","name":"trig","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":90,"y":1600,"wires":[["c875aa3.cc01b58"]]},{"id":"ebc51e96.75e7f","type":"function","z":"df22847e.c06768","name":"ui-table handler (placeholder)","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":530,"y":1600,"wires":[["888a468a.3245e8"]]},{"id":"888a468a.3245e8","type":"debug","z":"df22847e.c06768","name":"list update","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":770,"y":1600,"wires":[]}]
Cheers
JR