SMART datagrid v.1 > Functions

Back  Forward

DataLudi.createGridView  Function

Create GridView by Dom element id being transferred to parameter and column information array. 

The data set to be connected to the grid uses createGridDataSet function. 

function createGridView (containerId: String, columns: [Object], dom: Boolean);
Returns
Void
Parameters
containerId - String. required.
Element ID which will contain Grid Canvas or Div element.
columns - [Object].
Array of column setting objects.
dom - Boolean. Defaults to false.
If it is true, it will create the grid implemented by DOM element rather than Canvas. It will not be changed after creating the grid.
Code -1
    var columns = [{
        name: 'colName',
        fieldName: 'fldName'
    }, {
        name: 'colAddr',
        fieldName: 'fldAddr'
    }, 
    ...
    ];
    var grid = DataLudi.createGridView('gridContainer', columns);
    // or DOM version
    var grid = DataLudi.createGridView('gridContainer', columns, true);
See Also
GridView
GridColumn
createGridDataSet
createTreeView
Examples
Hello Grid