I am currently working with node-red and I created some custom nodes.
Now, I want to update dynamically the node parameter form: I want to retrieve a list containing data label from a server and put them into a select so the user can choose what data he wants to get.
Here, for instance, I would like to get the data contained in the container from broker. So what I want to do is to add a new select input when the container and the broker are filled.
Is it possible to do such a thing?
I already took a look into the custom edit behaviour (http://nodered.org/docs/creating-nodes/properties) but there are only events when the form is validated/cancelled/opened/... there are not events on the inputs themselves.
Thank you for the help :)
Gabi.
This is how several Node-RED nodes work. You need to use the oneditprepare
function in the node's HTML file to call a HTTP endpoint hosted by your node.
You can also attach onchange
type hooks to fields in the form to update later fields based on earlier input using AJAX style calls.
There are plenty of examples in the node-red-nodes git repository, have a look at things like the serial port node for example that looks up a list of available ports that can be configured.