Search code examples
jquerynode-red

Add node properties in html with jQuery


I want to add new properties to a custom node with jQuery. I use the jQuery code in "oneditprepare" and the jQuery function adds the properties in the Edit window. But if I click on Deploy and if I go to the Edit window again, the jQuery properties are gone.

I have added the properties with $(...).append(...);

Is there are possiblity to add properties with jQuery, while Node-Red is running. I push the data from the html to the js code with an array and it works good.


Solution

  • You need to use the oneditsave function to ensure the new parameters are stored properly.

    Look at the switch node or the change node for examples of using the EditableList type as this is probably the best way to approach this.