Possibility to dynamically update node properpty Window?

Hello Node-RED community!

I want to know if it is possible to update the property window of the node by connecting to a server in the .html file of the node and input this information to the properties window.

Example:
Instead of 1 and 2, I want to display name of the available devices in the server and it will get updated if I add a new device.

Any guidance / assistance would be greatly appreciated. I also apologize in advance if my post is not consistent with how it is supposed to be done as this is my first post.

Thank you all in advance.

Hussain

Yes it is. There are a number of nodes that do this. The Editor has access to jQuery which can help. Generically, you will need to do an Ajax call to the remote endpoint. You need to trigger that call whenever you want to refresh the dropdown. Typically you just refresh the list when the panel is opened. When that happens, the oneditprepare function is run so you can trigger the update there.

uibuilder has several examples of this along with examples of defining an API within the node.

Great, thanks for your guidance. As you said there are many nodes with this kind of functionality, it would be really helpful if you can tell the name of any other node which uses it.

The commonly used example is the serial-in node.

If you want to look at the uibuilder code, use the vNext branch at the moment and look in the src/editor/uibulder.editor.js file for the API calls. For example, line 290 function packageList. The API's themselves are in nodes/libs either admin-api-v2.js or admin-api-v3.js.

1 Like

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