Index

Classes

Class

Methods

Class Banana.Controls.DataGrid


Extends Banana.Controls.ListControl.

Methods borrowed from class Banana.Controls.ListControl:
dataSetSourceBind, getDataSource, setDataKeyField, setDataValueField
Methods borrowed from class Banana.Controls.DataControl:
dataSetBind, 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: Datagrid.js.

Class Detail
Banana.Controls.DataGrid()

Creates a datagrid A datagrid is a more advanced list control with functionality to have its own listrender. A listrender is responsible for rendering the list and is completely independent from the datagrid itself. By default a datagrid is having a table list render . A different listrender can replace the current listrender if desired at anytime. Empty template can be assigned to a datagrid which is shown when there is no data inside the datagrid.

 Example:

var datagrid = new Banana.Controls.DataGrid();

var columns = [
                new Banana.Controls.DataGridColumn().setHeaderText('name').setDataField('name'),
                new Banana.Controls.DataGridColumn().setHeaderText('description').setDataField('description')
              ];

datagrid.getListRender().setColumns(colums);

var datasource = [
                    {'name':'a name1','description':'a description1'},
                    {'name':'a name2','description':'a description2'},
                    {'name':'a name3','description':'a description3'}
                 ];

datagrid.setDataSource(datasource);   

this.addControl(datagrid);
Method Detail
{this} clearEmptyTemplate()

clears the empty template.

Returns:
{this}
{this} clearListRender()

Clears the list render.

Returns:
{this}
{mixed} getData()

equal to getDataSource

Returns:
{mixed}

returns current active list render. If none is active we return a default table list render

Returns:
{Banana.Controls.DataGridBaseListRender} listRender
{this} setControlPanel(c)

add a control panal above the datagrid. A control panel is used as a container for filters and other controls interacting with the datagrid.

Parameters:
{Banana.Controls.DataGridControlPanel} c
Returns:
{this}
{this} setData(data)

setData method is equal to the setDataSource method. This method is used when datagrid is binded to data in a dataset.

Parameters:
{mixed} data
Returns:
{this}
{this} setDataSource(datasource)
Parameters:
{mixed} datasource
to fill the datagrid with
Returns:
{this}
{this} setEmptyTemplate(c)

An empty template is shown when no datasource or empty datasource is inside the datagrid.

Parameters:
{Banana.Controls.UiControl} c
Returns:
{this}
{this} setListRender(lr)

Sets the list render responsible for rendering content. If changed during runtime we rerender the complete datagrid.

Parameters:
{Banana.Controls.Banana.Controls.DataGridBaseListRender} lr
Returns:
{this}

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