Class: Button

hui.ui. Button


new Button(options)

A push button

options: {
 element : «Element | ID»,
 name : «String»,
 data : «Object»,
 confirm : {text : «String», okText : «String», cancelText : «String»},
 submit : «Boolean»
}

Events:
$click(button) - When the button is clicked (and confirmed)
Parameters:
Name Type Description
options Object

The options

Source:

Methods


<static> create()

Creates a new button

options: {
 text : «String»,
 title : «String», // deprecated
 highlighted : «true | false»,
 enabled : «true | false»,
 icon : «String»,

 name : «String»,
 data : «Object»,
 confirm : {text : «String», okText : «String», cancelText : «String»},
 submit : «Boolean»,

 listener : «Object»
}
Source:

click(func?)

Registers a function as a click listener or issues a click

Parameters:
Name Type Description
func? function

The function to run when clicked, leave out to issue a click

Source:

disable()

Disables the button

Source:

enable()

Enables the button

Source:

focus()

Focus the button

Source:

getData()

Get the data object for the button

Source:
Returns:

The data object

Type
Object

getRole()

Get the role of the button

Source:
Returns:

The role

Type
String

onClick(func)

Registers a function as a click handler

Parameters:
Name Type Description
func function

The fundtion to invoke when clicked click

Source:

setEnabled(enabled)

Enables or disables the button

Parameters:
Name Type Description
enabled Boolean

If the button should be enabled

Source:

setHighlighted(highlighted)

Sets whether the button is highlighted

Parameters:
Name Type Description
highlighted Boolean

If the button should be highlighted

Source:

setText()

Sets the button text

Parameters:
Type Description
Source: