RED.nodes.eachConfig - limit to only enabled nodes?


I am using RED.nodes.eachConfig in my custom side panel, so the side panel can work with different instances of a config node. (each instance has various HTTP Admin Endpoints addressed by their id)

And all this works well.

However, I find that RED.nodes.eachConfig also returns disabled nodes (config nodes in this case).
and the array items returned by RED.nodes.eachConfig does not contain the enabled property (which would have been perfect)

Any ideas?

As currently it will list a config node that is not enabled.
I guess I am after how I can obtain the enabled property for a config node within the editor (or side panel to be precise)

Sorry if I have put this under wrong category

There is no such property. There is, however, a disabled property that will be set to true if the node is disabled.

Thanks @knolleary

I think I found it.

But I think its not disabled it's d as it appears for a disabled config node?

Screenshot 2022-12-23 at 17.53.59

Ah yes. That's it

1 Like

Are you sure you want to use RED.nodes.eachConfig? The reason I'm asking is that that gives you a point-in-time snapshot. I think you're better off with nodes:add, nodes:change, and nodes:remove hooks so you can update your sidebar as config nodes are added/removed...

No, eachConfig is perfect as that is used during side panel render time only, which is client side.

I also use the RED.Comms namespace and this updates the side panel as my config nodes advertise them self during start up, which the client side panel subscribes to. This needs to happen only when the config node has fully initialised, and is ready for interaction.

eachConfig is used to render currently known configs when the editor is loaded , after this, RED.Comms takes over

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