Caplin Trader 5.1.0

Class: module:ct-workbench/model/ToggleSlider

module:ct-workbench/model/ToggleSlider(defaultValueopt, labelOnopt, labelOffopt, labelopt)

new module:ct-workbench/model/ToggleSlider(defaultValueopt, labelOnopt, labelOffopt, labelopt)

A configurable toggle switch, used in multiple workbench tools. To listen to the value change, add a listener directly to the value property, e.g. toggleSlider.value.addChangeListener(...)

Extends:
Parameters:
Name Type Attributes Default Description
defaultValue Boolean <optional>
false

If true, start slider in the ON position, else the OFF position.

labelOn String <optional>
'ON'

The label to use for the ON position.

labelOff String <optional>
'OFF'

The label to use for the OFF position.

label String <optional>
''

The contents of a label for the whole toggle.

Extends

Methods

click()

Toggle the value between true and false