Caplin Trader 4.7.1

Class: module:caplin/workbench/model/ToggleSlider

module:caplin/workbench/model/ToggleSlider

Constructor

new module:caplin/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