new Buttons(optionsopt)
- Source:
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options.buttons |
Array.<(Object|String)> |
<optional> |
[]
|
A list of
Button instances, button options objects or label strings
which is converted to button instances on init. If |
options.direction |
String |
<optional> |
"horizontal"
|
The layout of the button list, either "horizontal" or "vertical". |
options.select |
Integer | Button | Array.<Integer> | Array.<Button> |
<optional> |
-1
|
The Button or a list of Buttons, depending on
|
options.button_class |
Object |
<optional> |
Button
|
A class to be used for instantiating new buttons. |
options.button_role |
String |
<optional> |
'option'
|
A role to be used for instantiating new buttons. |
options.multi_select |
Integer |
<optional> |
0
|
Set to |
options.deselect |
Boolean |
<optional> |
false
|
Define if single-selection
( |
Buttons is a list of (Button)s, arranged
either vertically or horizontally. Single buttons can be selected by clicking.
If multi_select
is enabled, buttons can be added and removed from
the selection by clicking on them. Buttons uses warning
to highlight buttons which can't be selected due to options.multi_select=n
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
Object |
<optional> |
{ }
|
An object containing initial options. |
Extends
Members
buttons :ChildWidgets
- Source:
An instance of ChildWidgets holding all Buttons.
Type:
- ChildWidgets
element :HTMLDivElement
- Source:
- Overrides:
The main DIV container.
Has class .aux-buttons
.
Type:
- HTMLDivElement
Methods
addButton(options, positionopt) → {Button}
- Source:
Adds a Button to Buttons.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Button | Object | String | An alread instantiated Button, an object containing options for a new Button to add or a string for the label of the newly created Button. |
|
position |
integer |
<optional> |
The position to add the Button
to. If |
Returns:
The Button instance.
- Type
- Button
addButtons(list)
- Source:
Adds an array of buttons to the end of the list.
Parameters:
Name | Type | Description |
---|---|---|
list |
Array.<(string|object)> | An Array containing Button instances, objects with options for the buttons (see Button for more information) or strings for the buttons labels. |
empty()
- Source:
Removes all buttons.
getButtons() → {Array.<Button>}
- Source:
Returns:
The list of Buttons.
- Type
- Array.<Button>
hide()
- Source:
- Inherited From:
Starts the transition of the visible
to false
.
hideChild(child)
- Source:
- Inherited From:
Switches the hidden state of a child to hidden
.
The argument is either the child index or the child itself.
Parameters:
Name | Type | Description |
---|---|---|
child |
Object | integer | Child or its index. |
isChildHidden(child) → {boolean}
- Source:
- Inherited From:
Returns true if the given child is currently marked as hidden in this container.
Parameters:
Name | Type | Description |
---|---|---|
child |
number | Widget |
Returns:
- Type
- boolean
isSelected(button) → {Boolean}
- Source:
Checks if an index or Button is selected.
Parameters:
Name | Type | Description |
---|---|---|
button |
Integer | Button | button index or Button instance. |
Returns:
- Type
- Boolean
removeButton(button, destroy)
- Source:
Removes a Button from Buttons.
Parameters:
Name | Type | Description |
---|---|---|
button |
integer | Button | button index or the Button instance to be removed. |
destroy |
Boolean | destroy the Button after removal. |
show()
- Source:
- Inherited From:
Starts the transition of the visible
to true
.
showChild(child)
- Source:
- Inherited From:
Switches the hidden state of a child to shown
.
The argument is either the child index or the child itself.
Parameters:
Name | Type | Description |
---|---|---|
child |
Object | integer | Child or its index. |
toggleChild(child)
- Source:
- Inherited From:
Toggles the hidden state of a child. The argument is either the child index or the child itself.
Parameters:
Name | Type | Description |
---|---|---|
child |
Object | integer | Child or its index. |
Events
added
- Source:
A Button was added to Buttons.
Parameters:
Name | Type | Description |
---|---|---|
button |
Button | The Button which was added to Buttons. |
removed
- Source:
A Button was removed from the Buttons.
Parameters:
Name | Type | Description |
---|---|---|
button |
Button | The Button instance which was removed. |
useraction
- Source:
The useraction
event is emitted when a widget gets modified by user interaction.
The event is emitted for the option select
.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the option which was changed due to the users action |
value |
mixed | The new value of the option |
useraction
- Source:
The useraction
event is emitted when a widget gets modified by user interaction.
The event is emitted for the option select
.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the option which was changed due to the users action |
value |
mixed | The new value of the option |