node-red.github.io
node-red.github.io copied to clipboard
Document node 'button' property
button: {
toggle: "active",
enabled: function() {
return !this.changed
},
onclick: function() { }
}
Notes:
-
toggleidentifies this should be a toggle switch (as used by Debug node). Value is a string that identifies the node property whose value should be toggled betweentrueandfalse. -
enabledis a function that can be used to determine if the button is active or not - cannot be used withtoggle- new for 0.17. -
onclickis a function that is called when the button is clicked. This function is called regardless of what theenabledfunction may have returned; in other words, even ifenabledreturnedfalse, this function will still be called when the button is clicked. This allows the node to display a custom notification to tell the user why the button is not enabled.