WTUI Docs

WTUI  1.0.0

WTUI Docs > WTUI > WTUI.DropDownControl
Search:
 
Filters

Class WTUI.DropDownControl

A Drop Down Control

Tag

<wtui:control type="WTUI.DropDownControl"/>

The tag for WTUI.DropDownControl

Example:

<wtui:control type="WTUI.DropDownControl" id="exampleid" >
  <wtui:option value="1">One</wtui:option>
  <wtui:option value="2">Two</wtui:option>
<wtui:control />
Parameters:
id <String> (optional) The id of the drop down control
name <String> (optional) The name of the control if it is used within a form
options <String> (optional) A JSON encoded array of options
value <String> (optional) The value of the control
onchange <Function>

Methods

getValue

String getValue ( )

Get the value

Returns: String
The value of the control

setOptions

void setOptions ( options )

Set the options for the drop down

Parameters:
options <object> (String) A JSON encoded array of options
Returns: void

setValue

void setValue ( value )

Set the value

Parameters:
value <String> The value
Returns: void

Events

change

change ( value )
Fired when the value of the dropdown changes

Example:
WTUIComponent('dropdownid').on('change', function() {
  alert('value changed to ' + this.getValue());
}
Parameters:
value <String> The new value of the control

WTUI