Index

Classes

Class

Methods

Class Banana.Controls.CustomListControl


Extends Banana.Controls.ListControl.

Methods borrowed from class Banana.Controls.ListControl:
dataSetSourceBind, getDataSource, setDataKeyField, setDataValueField
Methods borrowed from class Banana.Controls.DataControl:
dataSetBind, getData, unDataSetBind, updateDisplay
Methods borrowed from class Banana.Controls.Panel:
getTagName
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: CustomListControl.js.

Class Detail
Banana.Controls.CustomListControl()

Creates a base custom list control. Use this class as a wrapper arround your custom list controls which are using datasource and or data. if setDatasource of setData is called we call createControls method in which the creation of controls should be defined

basicly this control rerenders the whole control + child collection when calling either data or datasource It handles all the clearing and re-rendering.

Example:

        //define the class
        var myList = Banana.Controls.CustomListControl.extend({

        createControls : function()
        {
            var i,len;
            for (var i=0,len=this.datasource.length;i<len;i++)
            {
                var label = new Banana.Controls.Label();
                label.setData(this.datasource[i]);
                this.addControl(label);

                //if this datasource item is in our data make background red
                if (this.data.indexOf(this.datasource[i] != -1))
                {
                    label.setStyle("background-color:red");
                }
            }
        }

        });

        //populate the list with datasource
        myList.setDataSource(['first','second','third');
        myList.setData(["third"]);
Method Detail
createControls()

this function is called when set data or set datasource is called overwrite this function to create your own logic

{this} setData(data, ignoreEvent, ignoreDom)

sets data on control. when this function is called we also clear the control and invalidate the display to rerender the control

Parameters:
{mixed} data
for control
{bool} ignoreEvent
when true we dont trigger
{bool} ignoreDom
when true we dont update dom
Returns:
{this}
{this} setDataSource(ds)

Sets datasource on control. when this function is called we also clear the control and invalidate the display to rerender the control

Parameters:
{mixed} ds
datasource for the control
Returns:
{this}
setDomData()

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