Skip to main content

CheckBox()

Add checkbox to dialog view

Constructor​

CheckBox(id: number, text: string)
CheckBox(id: number, text: string, defaultChecked: boolean)

Parameters​

ParametersTypeDescription
idnumberUnique identifier of the checkbox, the id is used in Dialog:getValueById()
textstringCustom text next to the checkbox
defaultCheckedbooleanOptional initial checked state

Notes​

  • The third parameter is optional
  • Set defaultChecked to true if you want the checkbox selected by default
  • The default is only the starting answer: once the user has answered, their saved answer is used on every later run
  • Like every dialog item, it has showWhen(), hideWhen() and setHelp()