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.
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);
- Returns:
- {Banana.Controls.DataGridControlPanel}
returns current active list render. If none is active we return a default table list render
- Returns:
- {Banana.Controls.DataGridBaseListRender} listRender
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}
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}
- Parameters:
- {mixed} datasource
- to fill the datagrid with
- Returns:
- {this}