node-red.github.io icon indicating copy to clipboard operation
node-red.github.io copied to clipboard

Document node 'button' property

Open knolleary opened this issue 8 years ago • 0 comments

button: {
            toggle: "active",
            enabled: function() {
                return !this.changed
            },
            onclick: function() { }
}

Notes:

  1. toggle identifies 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 between true and false.
  2. enabled is a function that can be used to determine if the button is active or not - cannot be used with toggle - new for 0.17.
  3. onclick is a function that is called when the button is clicked. This function is called regardless of what the enabled function may have returned; in other words, even if enabled returned false, 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.

knolleary avatar Apr 23 '17 22:04 knolleary