Index

Classes

Class

Methods

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
{mixed} getData()
Returns:
{mixed}
{String} getOptGroupField()
Returns:
{String}
{String} getPromptText()
Returns:
{String}
{String} getTagName()
Returns:
{String}
{this} setData(data)

Set the data of the Control

Parameters:
{mixed} data
Data to set
Returns:
{this}
{this} setDataByIndex(index)

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}
{this} setOptGroupField(value)

Sets the optgroup

Parameters:
{String} value
Returns:
{this}
{this} setPromptText(text)

Sets the prompt text. This text is visible as first option in the dropdown. Note that a prompt text doesnt have a value. calling getData() while prompttext is selected results in undefined

Parameters:
{String} text
Returns:
{this}
<static>
{this} Banana.Controls.DropDown.useOptGrouping()

When called we use opt grouping. By default the optgroup field is "group"

Returns:
{this}

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 05 2012 22:01:51 GMT+0100 (CET)