Basic class for button controls.
Type | Description | |
active | Boolean |
If true, force the control to enter the active state and classname 'amos-form-active' will be added. |
busy | Boolean | If true, this forces the control to enter the busy state and classname 'amos-form-busy' will be added. |
disabled | Boolean | If true, any control's events(except change) are not responding. Its content cannot be edited and is excluded when the form is submitted. |
enabledToggle | Boolean |
If true, the button works as a toggle button. Toggle button is a button that enters active state after it is clicked and remains in active state until it is clicked again to return to normal state. |
error | Boolean | If true, this forces the control to enter the error state and classname 'amos-form-error' will be added. |
filled | Boolean | A flag that shows whether a form element is filled in (true) or empty (false). |
id | String |
An unique id for an element. (The specified value must be unique within the document.) |
label | String | Label of an element. |
name | String |
Name of button. When sending a request to server, this property is the parameter's name. |
readOnly | Boolean | If true, the control is read-only and cannot be edited. However, its content, if presents, is included in form submission. |
valid | Boolean | Validity flag that shows whether a form element is validated to be valid (true) or invalid (false). |
value | String | Number | Object | Value of the element. |
viewMode | Boolean | If true, the control will show only the displayedValue. |
Return type | Description | |
activate() | None |
Force the button to enter the activate state. |
deactivate() | None |
Force the button to enter the normal state. |
hide(elem?) | None | Hide a specified element. The hidden element will not be displayed at all. |
isValid() | Boolean | Returns true when value validation succeeded; otherwise, false. |
isVisible(elem?) | Boolean | Return true if the element is visible, otherwise false. |
reset() | None | Reset all state and value to default. |
show(elem?) | None | Display a specified element. |
toggle(elem?) | None | Toggle visibility of a specified element. |
Description | ||
blur |
Fires when an object loses focus. |
|
click |
Fires when the user clicks on a button. |
|
dblclick |
Fires when the user double-clicks on a button. |
|
focus |
Fires when an element gets focus. |
|
keydown |
Fires when the user is pressing a key (on the keyboard). |
|
keypress |
Fires when the user presses a key (on the keyboard). |
|
keyup |
Fires when the user releases a key (on the keyboard). |
|
mousedown |
Fires when a user presses a mouse button over an element. |
|
mouseout |
Fires when the mouse pointer is moved out of an element. |
|
mouseover |
Fires when the mouse pointer is moved onto an element. |
|
mouseup |
Fires when a user releases a mouse button over an element. |
If true, force the control to enter the active state and classname 'amos-form-active' will be added.
Default value: false
Default value: false
Default value: false
If true, the button works as a toggle button. Toggle button is a button that enters active state after it is clicked and remains in active state until it is clicked again to return to normal state.
Default value: false
Default value: false
Default value: false
Name of button. When sending a request to server, this property is the parameter's name.
Default value: false
Default value: true
Force the button to enter the activate state.
Force the button to enter the normal state.
<Node>
elem
|
Optional |
Specified element to be hidden.
|
<Node>
elem
|
Optional |
Specified element to be checked. If not specified, domNode of the widget is used instead.
|
<Node>
elem
|
Optional |
Specified element to be displayed.
|
<Node>
elem
|
Optional |
Specified element to toggle visibility.
|
Fires when the user double-clicks on a button.
<Object>
evt
|
-javascript event object |
Fires when the user is pressing a key (on the keyboard).
<Object>
evt
|
-javascript event object |
Fires when the user presses a key (on the keyboard).
<Object>
evt
|
-javascript event object |
Fires when the user releases a key (on the keyboard).
<Object>
evt
|
-javascript event object |
Fires when a user presses a mouse button over an element.
<Object>
evt
|
-javascript event object |
Fires when the mouse pointer is moved out of an element.
<Object>
evt
|
-javascript event object |
Fires when the mouse pointer is moved onto an element.
<Object>
evt
|
-javascript event object |
Fires when a user releases a mouse button over an element.
<Object>
evt
|
-javascript event object |