getScale(id).settings.callback( sequenceOfCommands )
(since beta 0.4)
Executes a sequence of commands whenever a choice is made on the scale. This is particularly useful if, for example, you want to reveal a TextInput element only when a certain option is chosen.
Example:
[js highlight=”7-12″ try=”true”]
newTextInput( “other” , “” )
.settings.hidden()
,
newScale(“yarrel”, “Yanny”, “Laurel”, “other”)
.settings.labelsPosition( “right” )
.settings.after( getTextInput(“other”) )
.settings.callback(
getScale(“yarrel”)
.test.selected( “other” )
.success( getTextInput(“other”).settings.visible() )
.failure( getTextInput(“other”).settings.hidden() )
)
.print()
[/js]