Chuyển tới nội dung chính

hideWhen()

The opposite of showWhen(): hides an item while a checkbox is ticked, or while an option is chosen. So it shows while the checkbox is not ticked, or while any other option is chosen.

Signature​

hideWhen(checkBoxId: number): DialogComponent
hideWhen(radioGroupId: number, optionId: number): DialogComponent

Returns

The same item, so calls can chain

Example​

Dialog:add(CheckBox(1, "Use the default Attack position", true))
-- Only asked when the box is not ticked
Dialog:add(TapPicker(2, "Tap the Attack button"):hideWhen(1))

In the Block Editor, this is show when with not checked or not option id.