The items of the lists are generated in another flow.
The idea of the list is, to control the items and maybe change the amount of them.
There also should be the possibility und confirm the input with a hook.
Can you just use a javascript object? var inventory = {"widgets": 5, "froglets: 1}
then inventory["widgets"] = inventory["widgets"] - 1
or inventory[partName] = inventory[partName] - 1
or maybe an array var inventory = [{name: "widgets", quantity: 5},{name: "froglets", quantity: 1}]
Hi all,
I am looking for a similar drop down list node whose length and contents node can be set dynamically.
In my case i have a static primary list from which the user can select one value. Based on this value, a secondary list needs to open up, showing a set of options to select from.
For instance, if the primary list contains two options - "Petrol" and "Diesel".
For the selection of primary option Petrol, the secondary list might show three options - "Normal ", "HighSpeed", "FuelSaver".
For the selection of primary option "Diesel", the secondary list might show only two options - "Standard"," Turbo".
So i would like to insert a function node after the primary drop down list node to interpret the primary selection and show or hide the available options in the secondary list as per the primary selection.
Is this possible in Node-red at all ?
As per latest node version, the lists can only be static, so, i will have both the secondary lists displayed on the UI at all times, and then process the secondary option separately based on the primary selection. It clutters up the UI .....
I have another question - please forgive my ignorance, but as i understand, the Node system works on events. Is that correct? So unless there is an event or change, there is no way to know what is the default item at the top of the list in a drop down node? This node only outputs a payload when any selection is changed - not even if you select the same option again.
Any information on the above questions is welcome ...
Chary BS