Hide/show nodes in dashboard

Hello ,
how to hide/show nodes in node-red intead of groups/tabs with the "ui_control" node?

For exemple if i click on "manual" button the input1 hides and input2 shows and when I click on "auto" button the input2 hides and input1 shows

[
    {
        "id": "f4e62d034a509e35",
        "type": "ui_ui_control",
        "z": "ab033ef24ad8b935",
        "name": "",
        "events": "all",
        "x": 1100,
        "y": 300,
        "wires": [
            []
        ]
    },
    {
        "id": "e323ed789187ccab",
        "type": "ui_button",
        "z": "ab033ef24ad8b935",
        "name": "",
        "group": "6d29b307540c9045",
        "order": 2,
        "width": "4",
        "height": "1",
        "passthru": false,
        "label": "Automatic",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 730,
        "y": 300,
        "wires": [
            [
                "4a7ca70dabf48b3c"
            ]
        ]
    },
    {
        "id": "4a7ca70dabf48b3c",
        "type": "change",
        "z": "ab033ef24ad8b935",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{\"node\":{\"hide\":[\"input1\"],\"show\":[\"input2\"]}}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 910,
        "y": 320,
        "wires": [
            [
                "f4e62d034a509e35"
            ]
        ]
    },
    {
        "id": "05234eefcc4a0465",
        "type": "change",
        "z": "ab033ef24ad8b935",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "{\"node\":{\"hide\":[\"input2\"],\"show\":[\"input1\"]}}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 920,
        "y": 220,
        "wires": [
            [
                "f4e62d034a509e35"
            ]
        ]
    },
    {
        "id": "e0db3e86970120cf",
        "type": "ui_button",
        "z": "ab033ef24ad8b935",
        "name": "",
        "group": "6d29b307540c9045",
        "order": 1,
        "width": "4",
        "height": "1",
        "passthru": false,
        "label": "Manual",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "{\"group\":{\"hide\":[]}}",
        "payloadType": "json",
        "topic": "topic",
        "topicType": "msg",
        "x": 700,
        "y": 240,
        "wires": [
            [
                "05234eefcc4a0465"
            ]
        ]
    },
    {
        "id": "5b04bbb43a028727",
        "type": "ui_text_input",
        "z": "ab033ef24ad8b935",
        "name": "input1",
        "label": "input1",
        "tooltip": "",
        "group": "6d29b307540c9045",
        "order": 2,
        "width": 0,
        "height": 0,
        "passthru": true,
        "mode": "text",
        "delay": 300,
        "topic": "topic",
        "sendOnBlur": true,
        "topicType": "msg",
        "x": 780,
        "y": 440,
        "wires": [
            []
        ]
    },
    {
        "id": "43b5cb57cc7bde81",
        "type": "ui_text_input",
        "z": "ab033ef24ad8b935",
        "name": "input2",
        "label": "input2",
        "tooltip": "",
        "group": "6d29b307540c9045",
        "order": 3,
        "width": 0,
        "height": 0,
        "passthru": true,
        "mode": "text",
        "delay": 300,
        "topic": "topic",
        "sendOnBlur": true,
        "topicType": "msg",
        "x": 770,
        "y": 500,
        "wires": [
            []
        ]
    },
    {
        "id": "6d29b307540c9045",
        "type": "ui_group",
        "name": "Group 1",
        "tab": "0bcba62bfbb44b2a",
        "order": 1,
        "disp": true,
        "width": 6
    },
    {
        "id": "0bcba62bfbb44b2a",
        "type": "ui_tab",
        "name": "Tab 7",
        "icon": "dashboard",
        "order": 7
    }
]

Not possible without using more groups.
e.g.

[{"id":"e0db3e86970120cf","type":"ui_button","z":"bf9e1e33.030598","name":"","group":"aa6a1221.d871c","order":1,"width":"4","height":"1","passthru":false,"label":"Manual","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"{\"group\":{\"hide\":[]}}","payloadType":"json","topic":"topic","topicType":"msg","x":170,"y":1300,"wires":[["05234eefcc4a0465"]]},{"id":"05234eefcc4a0465","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"group\":{\"hide\":[\"Tab_7_Group_1\"],\"show\":[\"Tab_7_Group_2\"]}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1280,"wires":[["f4e62d034a509e35"]]},{"id":"f4e62d034a509e35","type":"ui_ui_control","z":"bf9e1e33.030598","name":"","events":"all","x":570,"y":1360,"wires":[[]]},{"id":"4a7ca70dabf48b3c","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"group\":{\"hide\":[\"Tab_7_Group_2\"],\"show\":[\"Tab_7_Group_1\"]}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":1380,"wires":[["f4e62d034a509e35"]]},{"id":"e323ed789187ccab","type":"ui_button","z":"bf9e1e33.030598","name":"","group":"aa6a1221.d871c","order":2,"width":"4","height":"1","passthru":false,"label":"Automatic","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":200,"y":1360,"wires":[["4a7ca70dabf48b3c"]]},{"id":"aa6a1221.d871c","type":"ui_group","name":"Group 3","tab":"0bcba62bfbb44b2a","order":3,"disp":true,"width":6},{"id":"0bcba62bfbb44b2a","type":"ui_tab","name":"Tab 7","icon":"dashboard","order":7}]
1 Like

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