CheckableView
Type: CheckableView
Extends ViewScript class of the CheckableView.
Properties
Property | Description |
---|---|
| Since version 4.04.23, Named properties may be accessed directly instead of requiring getViewProperty / setViewProperty. The property ID may be identified in the Properties view. |
enabled
| Enables/disables the view. |
checked
| Get/Set the check state of the CheckableView view. |
text
| Get/Set the text of the CheckableView view. |
value
| Get/Set the check state of the CheckableView view. Synonymous with 'checked' |
Methods
Method | Description |
---|---|
callListener(eventName, [args])
| Calls all event listeners for the given event name, useful for testing. |
getViewProperties()
| Returns an array of objects containing the view properties. Each element has the fields 'name', 'id', 'value', 'hint'. If the property is a category then it will also have an array field 'properties'. These properties are the ones normally editable via the properties view. |
getViewProperty(id)
| Gets a property value from the view, given the property ID. Property IDs can be listed using getViewProperties. These properties are the ones normally editable via the properties view. |
on(eventName, callback)
| Adds an event listener for the given event name. e.g. view.on("click", function() { ... }); |
removeAllListeners([eventName])
| Removes all event listeners for the given event name. If the event name is not given then all listeners for all events are removed. |
removeListener(eventName, callback)
| Removes an event listener for the given event name. e.g. let callback = function() { ... }; view.on("click", callback); view.removeListener("click", callback); |
setViewProperty(id, value)
| Sets a property on the view, given the property ID and value. Property IDs can be listed using getViewProperties These properties are the ones normally editable via the properties view. |
Events
Event | Description |
---|---|
checked()
| Called when the view changed to the checked state. External scripts can bind to the 'checked' event to be notified. view.on("checked", function() { ... }); |
onClick(checked)
| Called in CheckableView scripts when the user clicked the CheckableView. External scripts can bind to the 'click' event to be notified when the user clicks the Button. view.on("click", function(checked) { ... }); The checked parameter is the new state of the CheckableView. The 'click' event is emitted when the user clicked the control. |
onGetValue()
| Gets the value that should be displayed by the CheckableView. Accesses to channels and options are tracked automatically, so changes to those values will cause onGetValue to be called again. |
onSetValue(checked)
| Called whenever the CheckableView state changes either through clicking or by another script setting the checked property. External scripts can bind to the 'change' event to be notified when the user clicks the Button. view.on("change", function(checked) { ... }); The checked parameter is the new state of the CheckableView. The 'change' event is emitted when the checked state changes either through clicking or by another script setting the checked property. |
unchecked()
| Called when the view changed to the unchecked state. External scripts can bind to the 'unchecked' event to be notified. view.on("unchecked", function() { ... }); |