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

**URL:** <https://discourse.nodered.org/t/red-nodes-eachconfig-limit-to-only-enabled-nodes/72642>\
**Category:** Core Development\
**Created:** [23 December 2022 17:12 UTC](https://discourse.nodered.org/t/red-nodes-eachconfig-limit-to-only-enabled-nodes/72642 "2022-12-23T17:12:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [23 December 2022 17:12 UTC](https://discourse.nodered.org/t/red-nodes-eachconfig-limit-to-only-enabled-nodes/72642/1 "2022-12-23T17:12:29Z")

</div>

So....

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.

 ![Screenshot 2022-12-23 at 17.06.22](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f1c4625269f1e7454a65961e5cb6e6ef66c5dfe1.png)

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

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 December 2022 17:50 UTC](https://discourse.nodered.org/t/red-nodes-eachconfig-limit-to-only-enabled-nodes/72642/2 "2022-12-23T17:50:49Z")

</div>

> [@marcus-j-davies](#):
>
> the array items returned by `RED.nodes.eachConfig` does not contain the `enabled` property

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

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [23 December 2022 17:54 UTC](https://discourse.nodered.org/t/red-nodes-eachconfig-limit-to-only-enabled-nodes/72642/3 "2022-12-23T17:54:45Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/64627a6a93c44ac495fda171af64820315b61e67.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 December 2022 18:01 UTC](https://discourse.nodered.org/t/red-nodes-eachconfig-limit-to-only-enabled-nodes/72642/4 "2022-12-23T18:01:21Z")

</div>

Ah yes. That's it

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [25 December 2022 00:22 UTC](https://discourse.nodered.org/t/red-nodes-eachconfig-limit-to-only-enabled-nodes/72642/5 "2022-12-25T00:22:24Z")

</div>

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...

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [25 December 2022 10:52 UTC](https://discourse.nodered.org/t/red-nodes-eachconfig-limit-to-only-enabled-nodes/72642/6 "2022-12-25T10:52:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 January 2023 10:52 UTC](https://discourse.nodered.org/t/red-nodes-eachconfig-limit-to-only-enabled-nodes/72642/7 "2023-01-08T10:52:42Z")

</div>

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