Enable/disable widgets

Looking at Control ui-control | Node-RED Dashboard 2.0 it would suggest that to be able to enable/disable a button or drop down box can be done by setting payload to JSON package and sending into a ui-control.
After trying for a while I've mocked up a little slider to toggle a button to be enabled/disabled and still can't get to work
msg.payload is essentially
{
"widgets": {
"enable": [
"6a9bb9324059ca6a"
]
}
}
where enable can be set to disable to grey out the control. and then there is an array of node ID's within this.
Setting msg.enable to true of false does work but makes a mess of the workflow designer when trying to control multiple widgets and then turn them on in a cascade.

Any ideas why my payload into a Ui-Control node in the attached flow
flows (7).json (6.0 KB)
doesn't work?

I'll bite.

Though I don't use DB 2.0

If you send a message with msg.enabled set to either true or false.

false should disable the GUI.
true should enable it.

I think that is an error in the docs, enable/disable of widgets via ui_control is not, as far as I know, supported.

@Trying_to_learn is correct, send a message to the node or nodes with msg.enabled true or false.

1 Like