SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.columns  property

Top Column list set in the grid. When set it, existing columns will all be removed. In general, you should set columns first after creating the grid. 

Getter
function columns(): [Column]
Setter
function setColumns(value: [Object|Column])
Code -1
    $(function () {
        grid.setColumns([
            {
                name: 'col1',
                fieldName: 'fld1'
            }, {
                name: 'col2',
                fieldName: 'fld2',
                width: 200
            }, {
                name: 'col2',
                orientation: 'vertical',
                width: 200,
                columns: [
                    {
                        name: 'col21',
                        fieldIndex: 0
                    }, {
                        name: 'col22',
                        fieldIndex: 1
                    }
                ]
            }
        ]);
    });
Note
See Also
GridColumn
GridBase.createColumn
Examples
Hello Grid