type

ButtonGroup

src @Js
class ButtonGroup : Obj

ButtonGroup groups a set of toggle or radio buttons and handles making sure only one button in group is selected at a time.

See also: docDomkit, ToggleButton, RadioButton

fields

buttons

Buttons in this group.

enabled

Set enabled state for this button group.

inheritEnabled

If true, child buttons will inherit the enabled state of this ButtonGroup.

selIndex

Index of selected button, or null if none selected.

methods

add

Convenience to add a button to buttons.

onBeforeSelect

Callback before a selection changes.

onSelect

Callback when selection in group has changed.

Slot Details

add

src This add(Elem button)

Convenience to add a button to buttons.

buttons

src Elem[] buttons := Elem[,]

Buttons in this group.

enabled

src Bool enabled := true

Set enabled state for this button group.

inheritEnabled

src Bool inheritEnabled := true

If true, child buttons will inherit the enabled state of this ButtonGroup. If false buttons can be enabled or disabled independent of group.

onBeforeSelect

src Void onBeforeSelect(|ButtonGroup,Int->Bool| f)

Callback before a selection changes. Return true to select the new button (default), or false to keep the currently selected button.

onSelect

src Void onSelect(|This| f)

Callback when selection in group has changed.

selIndex

src Int? selIndex := null

Index of selected button, or null if none selected.