Class Banana.Controls.DropDown
Extends
Banana.Controls.ListControl.
- Methods borrowed from class Banana.Controls.ListControl:
- dataSetSourceBind, getDataSource, setDataKeyField, setDataSource, setDataValueField
- Methods borrowed from class Banana.Controls.DataControl:
- dataSetBind, unDataSetBind, updateDisplay
- Methods borrowed from class Banana.UiControl:
- addControl, addCss, addCssClass, getAttribute, getAttributes, getClientId, getCss, getCssClass, getDimensions, getHtml, getHtmlAttributes, getState, getStyle, getStyleProperty, hasCssClass, registerEvents, removeAttribute, removeCssClass, removeState, setAttribute, setClientId, setCss, setEnabled, setState, setStyle, setVisible, switchCssClass, triggerEvent, unregisterEvents
- Methods borrowed from class Banana.Control:
- applyToChildren, bind, clear, createComponents, findControl, generateUniqueId, getControls, getDomEventTypes, getFirstUiControl, getId, getPage, getParent, getProxy, hasBind, invalidateDisplay, onPreInvalidateContents, onWindowResize, remove, render, setId, setPage, setParent, unbind, unload
Defined in: DropDown.js.
Class Detail
Banana.Controls.DropDown()
Creates a Dropdown
Example:
var dropdown = new Banana.Controls.DropDown();
this.addControl(dropdown);
dropdown.setDataSource([1,2,3,4,5,6,7,8,9]);
dropdown.setData(4);
///another way top populate datasource is with complex objects.
//by default complex objects should have a dataKeyField and dataValueField.
//where dataKeyField = key and dataValueField = value;
//To change this use setDataKeyField and setDataValueField.
dropdown.setDataSource([{key:1,value:'one'},{key:2,value:'two'}]);
dropdown.setData(2);
Method Detail
Set the data of the Control
- Parameters:
- {mixed} data
- Data to set
- Returns:
- {this}
Sets the data by index. If your datasource is ["foo","apple","me"] you can use setDataByIndex(1) to set apple as the data.
- Parameters:
- {int} index
- Returns:
- {this}