Unable to hide column in node-red-node-ui-table

Hello,

I have the following flow:

[
    {
        "id": "ef64e5df.b58d9",
        "type": "tab",
        "label": "Flow 3",
        "disabled": false,
        "info": ""
    },
    {
        "id": "2ada6432.b9daa4",
        "type": "ui_table",
        "z": "ef64e5df.b58d9",
        "group": "a158aa65.c97cd",
        "name": "Inventario",
        "order": 2,
        "width": "14",
        "height": "6",
        "columns": [],
        "outputs": 0,
        "cts": false,
        "x": 400,
        "y": 220,
        "wires": []
    },
    {
        "id": "c04fc8c7.592238",
        "type": "inject",
        "z": "ef64e5df.b58d9",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "ui_control.tabulator",
                "v": "{\t   \"dataTree\": true,\t   \"dataTreeStartExpanded\": true\t}",
                "vt": "jsonata"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[\t    {\t        \"nombre\": \"acceso\",\t        \"rd\": \"361\",\t        \"RTs a importar\":\"\",\t        \"Nombre RT\":\"\",\t        \"_children\":\t        [\t            {\"RTs a importar\":\"target:1234:321\", \"Nombre RT\":\"primero\"},\t            {\"RTs a importar\": \"target:1234:432\"}\t        ]\t    },\t    {\t        \"nombre-vrf\": \"gestion\",\t        \"rd\": \"1234:100\",\t        \"RTs a importar\":\"\",\t        \"_children\":\t        [\t            {\"RTs a importar\":\"target:1234:66\"}\t        ]\t    }\t]",
        "payloadType": "jsonata",
        "x": 80,
        "y": 240,
        "wires": [
            [
                "2ada6432.b9daa4",
                "fe8b7855.27332"
            ]
        ]
    },
    {
        "id": "fe8b7855.27332",
        "type": "debug",
        "z": "ef64e5df.b58d9",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 330,
        "y": 140,
        "wires": []
    },
    {
        "id": "da3f9327.24123",
        "type": "inject",
        "z": "ef64e5df.b58d9",
        "name": "",
        "props": [
            {
                "p": "ui_control.tabulator",
                "v": "{\"columns\":[{\"field\":\"rd\",\"visible\":false}]}",
                "vt": "json"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 110,
        "y": 380,
        "wires": [
            [
                "e7ae9fe6.8d7b2",
                "2ada6432.b9daa4"
            ]
        ]
    },
    {
        "id": "e7ae9fe6.8d7b2",
        "type": "debug",
        "z": "ef64e5df.b58d9",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 530,
        "y": 440,
        "wires": []
    },
    {
        "id": "a158aa65.c97cd",
        "type": "ui_group",
        "name": "Tabla",
        "tab": "3dd69d8b.6e4f72",
        "order": 3,
        "disp": true,
        "width": "14",
        "collapse": false
    },
    {
        "id": "3dd69d8b.6e4f72",
        "type": "ui_tab",
        "name": "Tab 1",
        "icon": "dashboard",
        "order": 1
    }
]

Injecting the first message to the table node, creates a table which displays all the columns I need, plus a column which header is "_children". I do not want to have this column shown, so I have tried several methods to hide it, one of which is injecting another message which tries to change the visibility option of that column to false. This did not work, so I tried hiding another column (rd), suspecting that maybe the _children column is an special one. This did not work either, the rd column is not been hidden. Now I have run out of ideas.

Any help would be appreciated.

Thanks

You would send a object in payload with command and arguments
e.g.

[{"id":"c04fc8c7.592238","type":"inject","z":"ef64e5df.b58d9","name":"","props":[{"p":"payload"},{"p":"ui_control.tabulator","v":"{\"dataTree\":true,\"dataTreeStartExpanded\":true}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"nombre\":\"acceso\",\"rd\":\"361\",\"RTs a importar\":\"\",\"Nombre RT\":\"\",\"_children\":[{\"RTs a importar\":\"target:1234:321\",\"Nombre RT\":\"primero\"},{\"RTs a importar\":\"target:1234:432\"}]},{\"nombre-vrf\":\"gestion\",\"rd\":\"1234:100\",\"RTs a importar\":\"\",\"_children\":[{\"RTs a importar\":\"target:1234:66\"}]}]","payloadType":"json","x":80,"y":240,"wires":[["2ada6432.b9daa4","fe8b7855.27332"]]},{"id":"2ada6432.b9daa4","type":"ui_table","z":"ef64e5df.b58d9","group":"2d4fe667.28f8ba","name":"Inventario","order":2,"width":"0","height":"0","columns":[],"outputs":0,"cts":false,"x":400,"y":220,"wires":[]},{"id":"fe8b7855.27332","type":"debug","z":"ef64e5df.b58d9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":330,"y":140,"wires":[]},{"id":"da3f9327.24123","type":"inject","z":"ef64e5df.b58d9","name":"hide","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\":\"hideColumn\",\"arguments\":[\"rd\"]}","payloadType":"json","x":110,"y":380,"wires":[["e7ae9fe6.8d7b2","2ada6432.b9daa4"]]},{"id":"401a7811be27a16d","type":"inject","z":"ef64e5df.b58d9","name":"show","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\":\"showColumn\",\"arguments\":[\"rd\"]}","payloadType":"json","x":110,"y":440,"wires":[["2ada6432.b9daa4"]]},{"id":"e7ae9fe6.8d7b2","type":"debug","z":"ef64e5df.b58d9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":440,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":2,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

most tabulator commands work, I found the commands here

Thanks, this works fine!!!

Is there a way to hide the column from the message that creates the table, ie, not needing to send a message to hide the column, but directly creating it hidden?

Sure, remove the property from the objects in the array.
e.g.

[{"id":"3f4fe15e311e3d2a","type":"inject","z":"ef64e5df.b58d9","name":"","props":[{"p":"payload"},{"p":"ui_control.tabulator","v":"{\"dataTree\":true,\"dataTreeStartExpanded\":true}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"nombre\":\"acceso\",\"rd\":\"361\",\"RTs a importar\":\"\",\"Nombre RT\":\"\",\"_children\":[{\"RTs a importar\":\"target:1234:321\",\"Nombre RT\":\"primero\"},{\"RTs a importar\":\"target:1234:432\"}]},{\"nombre-vrf\":\"gestion\",\"rd\":\"1234:100\",\"RTs a importar\":\"\",\"_children\":[{\"RTs a importar\":\"target:1234:66\"}]}]","payloadType":"json","x":130,"y":520,"wires":[["1029542c6833d714"]]},{"id":"1029542c6833d714","type":"change","z":"ef64e5df.b58d9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload ~> |$|{},[\"_children\"]|","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":480,"wires":[["3a3056228d5c4a7f","17ba17233c04a23b"]]},{"id":"3a3056228d5c4a7f","type":"ui_table","z":"ef64e5df.b58d9","group":"2d4fe667.28f8ba","name":"Inventario","order":2,"width":"0","height":"0","columns":[],"outputs":0,"cts":false,"x":450,"y":500,"wires":[]},{"id":"17ba17233c04a23b","type":"debug","z":"ef64e5df.b58d9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":380,"y":420,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":2,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Jsonata expression using transform

$$.payload ~> |$|{},["_children"]|

Thanks for your help, but that is not exactly what I was looking for.

What I need:

 Nombre       rd                 RTs a importar           Nombre RT
 ----------------------------------------------------------------------
 - acceso     361                target:1234:321          primero
 └                               target:1234:432
 gestion      1234:100           target:1234:66

What I am getting with the Jsonata approach:

 Nombre       rd                 RTs a importar           Nombre RT
 ----------------------------------------------------------------------
 acceso       361                         
              1234:100      

I did not notice the nested info, you could try this

[{"id":"b54e4d934d0bd952","type":"inject","z":"452103ea51141731","name":"","props":[{"p":"payload"},{"p":"ui_control.tabulator","v":"{\"dataTree\":true,\"dataTreeStartExpanded\":true}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"nombre\":\"acceso\",\"rd\":\"361\",\"RTs a importar\":\"\",\"Nombre RT\":\"\",\"_children\":[{\"RTs a importar\":\"target:1234:321\",\"Nombre RT\":\"primero\"},{\"RTs a importar\":\"target:1234:432\"}]},{\"nombre-vrf\":\"gestion\",\"rd\":\"1234:100\",\"RTs a importar\":\"\",\"_children\":[{\"RTs a importar\":\"target:1234:66\"}]}]","payloadType":"json","x":110,"y":700,"wires":[["f2a78d558a595fec","b43c2a0eeaac32e9"]]},{"id":"f2a78d558a595fec","type":"debug","z":"452103ea51141731","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":520,"y":660,"wires":[]},{"id":"b43c2a0eeaac32e9","type":"trigger","z":"452103ea51141731","name":"","op1":"","op2":"{\"command\":\"deleteColumn\",\"arguments\":[\"_children\"]}","op1type":"pay","op2type":"json","duration":"10","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":330,"y":720,"wires":[["5d02bf8047e5f83d"]]},{"id":"5d02bf8047e5f83d","type":"ui_table","z":"452103ea51141731","group":"2d4fe667.28f8ba","name":"Inventario ","order":2,"width":"12","height":"9","columns":[],"outputs":0,"cts":false,"x":600,"y":740,"wires":[]},{"id":"360ca0f5e45fb0ed","type":"inject","z":"452103ea51141731","name":"addColumn","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\":\"addColumn\",\"arguments\":[{\"title\":\"_children\",\"field\":\"_children\",\"data\":[{\"_children\":\"test\"},{\"_children\":\"test2\"}]},false,\"Nombre RT\"]}","payloadType":"json","x":130,"y":840,"wires":[["792e6b3b88e9d0cb","5d02bf8047e5f83d"]]},{"id":"a30939859c7d6184","type":"inject","z":"452103ea51141731","name":"deleteColumn","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\":\"deleteColumn\",\"arguments\":[\"_children\"]}","payloadType":"json","x":130,"y":900,"wires":[["5d02bf8047e5f83d"]]},{"id":"792e6b3b88e9d0cb","type":"debug","z":"452103ea51141731","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":960,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":2,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Great!!! This works like a charm!!

Thanks a lot for all your help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.