Node property resets itself

Hi,

My custom node property resets itself after re-opening it to reconfigure.
I am editing it as it is seen in the below image.

ss1

But if I re-open it after deploying, the Search for property resets itself to All as seen in the below picture.

ss2

While the Output property does not show this behaviour.

Here is the code for the related part.

defaults: {
            name: {value:""},
            searchFor: {value:""},
            searchForType: {value: ""},
            output: {value:""},
            outputType: {value: ""}
        },

/////somethings////////
oneditprepare: function() {
            $("#node-input-searchFor").typedInput({
                types:[
                    {
                        value: "All",
                        label: "All",
                        hasValue: false
                    },
                    {
                        value: "Name",
                        label: "Local Name"
                    }],
                typeField: "#node-input-searchForType"
            });
            $("#node-input-output").typedInput({
                types:[
                    {
                        value: "Peripheral",
                        label: "",
                        options: ["MAC", "Peripheral", "Data"]
                    }],
                typeField: "#node-input-searchForType"
            });
        }

It seems like I need to define a custom behaviour as it is explained here. I would appreciate any hint on this.

Try

typeField: $("#node-input-searchForType")

Also, have you created a hidden input for node-input-searchForType?

Hi @Steve-Mcl,

Yes I created hidden inputs. I have realized thanks to you that typeField: "#node-input-searchForType" for the node-input-output was wrong. I have changed it to typeField: "#node-input-outputType" and it works pretty well.

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