@omrid I have a dashboard page with 2 ui-tabulator tables that are configured dynamically (column names, formatters etc.) four different ways. I was using tbCmd = “tbCreateTbl” and tbInitObj = [table definition] but was running into an issue where the table was sometimes not created when the data arrived (there was an error on the table output - table not ready or not defined).
To get around this, I put in bare config in the ui-tabulator properties with blank columns. Now I can see a blank table on the dashboard, so that part is working. I then send in the column definition using tbCmd = “setColumns” and tbArgs = [column definition] but get an error “"Missing or invalid command”. Is there an alternate parameter to set table columns?
Below is a sample flow for just one.
Update: Ugh - just noticed that the change node and the ui-tabulator node are not connected in this flow (they are in mine). If you import the flow, can you please connect the two?
[{"id":"f59bf96f3227fe34","type":"inject","z":"defcf8ff528868a9","name":"Create M% Table","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1343.9521484375,"y":343.82720947265625,"wires":[["9c2a1a0b927a1299"]]},{"id":"3be882bc6843d5ec","type":"ui-button","z":"defcf8ff528868a9","group":"d66256702678bbe6","name":"Table - Month %","label":"Table - Month %","order":1,"width":"2","height":"1","emulateClick":true,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"","payloadType":"str","topic":"topic","topicType":"msg","buttonColor":"","textColor":"","iconColor":"","enableClick":true,"enablePointerdown":false,"pointerdownPayload":"","pointerdownPayloadType":"str","enablePointerup":false,"pointerupPayload":"","pointerupPayloadType":"str","x":1353.9521484375,"y":394.76837158203125,"wires":[["9c2a1a0b927a1299"]]},{"id":"9c2a1a0b927a1299","type":"change","z":"defcf8ff528868a9","name":"ui_Table Format (%) - M","rules":[{"t":"set","p":"tbCmd","pt":"msg","to":"setColumns","tot":"str"},{"t":"set","p":"tbArgs","pt":"msg","to":"[{\"formatter\":\"datetime\",\"formatterParams\":{\"inputFormat\":\"iso\",\"outputFormat\":\"yyyy-LLL\",\"invalidPlaceholder\":\"(invalid date)\"},\"title\":\"Day\",\"field\":\"created\",\"hozAlign\":\"center\",\"headerHozAlign\":\"center\",\"width\":\"17%\"},{\"formatter\":\"money\",\"formatterParams\":{\"precision\":2,\"symbol\":\"%\",\"symbolAfter\":true},\"title\":\"Grid\",\"field\":\"fromGridPct\",\"hozAlign\":\"right\",\"headerHozAlign\":\"center\",\"width\":\"18%\"},{\"formatter\":\"money\",\"formatterParams\":{\"precision\":2,\"symbol\":\"%\",\"symbolAfter\":true},\"title\":\"Solar\",\"field\":\"fromSolarPct\",\"hozAlign\":\"right\",\"headerHozAlign\":\"center\",\"width\":\"20%\"},{\"formatter\":\"money\",\"formatterParams\":{\"precision\":2,\"symbol\":\"%\",\"symbolAfter\":true},\"title\":\"Battery\",\"field\":\"fromBatteryPct\",\"hozAlign\":\"right\",\"headerHozAlign\":\"center\",\"width\":\"22%\"},{\"formatter\":\"money\",\"formatterParams\":{\"precision\":2,\"symbol\":\"%\",\"symbolAfter\":true},\"title\":\"Total\",\"field\":\"totalHomePct\",\"hozAlign\":\"right\",\"headerHozAlign\":\"center\",\"width\":\"20%\"}]","tot":"json"},{"t":"delete","p":"topic","pt":"msg"},{"t":"set","p":"metricOld","pt":"flow","to":"metric","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1591.128662109375,"y":396.82720947265625,"wires":[["ebbfd0208d43ef52"]]},{"id":"8aefd49fc01bb33c","type":"ui-tabulator","z":"defcf8ff528868a9","name":"Table-2","group":"70c8e6416fd84914","initObj":"{\n \"height\": \"100%\",\n \"columns\": [\n {\n \"formatter\": \"datetime\",\n \"formatterParams\": {\n \"inputFormat\": \"iso\",\n \"outputFormat\": \"yyyy-LLL\",\n \"invalidPlaceholder\": \"(invalid date)\"\n },\n \"title\": \"Day\",\n \"field\": \"created\",\n \"hozAlign\": \"center\",\n \"headerHozAlign\": \"center\",\n \"width\": \"17%\"\n },\n {\n \"formatter\": \"money\",\n \"formatterParams\": {\n \"precision\": 2,\n \"symbol\": \"%\",\n \"symbolAfter\": true\n },\n \"title\": \"Grid\",\n \"field\": \"fromGridPct\",\n \"hozAlign\": \"right\",\n \"headerHozAlign\": \"center\",\n \"width\": \"18%\"\n }\n ]\n}","funcs":"","allowMsgFuncs":false,"maxWidth":"","events":"cellEdited,rowDblClick","order":1,"multiUser":false,"validateRowIds":false,"themeFile":"@CSS:tabulator_midnight.min.css","tblDivId":"","width":"8","height":"8","x":2118.6578369140625,"y":487.18016815185547,"wires":[["cd8454d7ac42af30"]]},{"id":"cd8454d7ac42af30","type":"debug","z":"defcf8ff528868a9","name":"Table-2 Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":2293.6578369140625,"y":487.8069763183594,"wires":[]},{"id":"d66256702678bbe6","type":"ui-group","name":"Buttons - Monthly","page":"561dc2b9ba26313a","width":6,"height":1,"order":3,"showTitle":true,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"70c8e6416fd84914","type":"ui-group","name":"ui-tabulator Example","page":"561dc2b9ba26313a","width":"9","height":"9","order":4,"showTitle":true,"className":"grp-name","visible":"true","disabled":"false","groupType":"default"},{"id":"561dc2b9ba26313a","type":"ui-page","name":"Tabulator Example","ui":"de5759a313e7ad79","path":"/tbl-example1","icon":"table","layout":"flex","theme":"b7b1935fbb33bbc8","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":15,"className":"","visible":"true","disabled":"false"},{"id":"de5759a313e7ad79","type":"ui-base","name":"Node-RED Dashboard DB2","path":"/dashboard","appIcon":"","includeClientData":false,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"headerContent":"dashboard","navigationStyle":"fixed","titleBarStyle":"default","showReconnectNotification":true,"notificationDisplayTime":5,"showDisconnectNotification":true,"allowInstall":true},{"id":"b7b1935fbb33bbc8","type":"ui-theme","name":"Default theme","colors":{"surface":"#ffffff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]
Alternatively, is there a way to “stack” commands to ui-tabulator (send the configuration and the data together)? In the old ui_table, I was sending in the configuration with ui_control and the data in msg.payload so both arrived at the same time but that doesn’t appear to be possible with ui-tabulator. Any help or suggestions would be really appreciated. Thanks.