SMART datagrid v.1 > Classes > GridView

Back  Forward

DataLudi.GridView.addGroupBy  method

Add the data field being connected to column to index location of the existing row group field list. The field which has already done grouping will not be added again. And, in the case of merged mode, the column should be root column. 

function addGroupBy (index: Integer, column: DataColumn);
Returns
Void
Parameters
index - Integer. required.
column - DataColumn. required.
Code -1
    $('#groupby').click(function (ev) {
        var column = grid.focusedColumn();
        if (column instanceof DataColumn) {
            if (grid.addGroupBy(grid.rowGroupLevels(), column)) {
                console.log('GroupBy field is added: ' + column.dataIndex()
        }
    });
Note
You cannot add during Editing.
See Also
removeGroupBy
groupBy
clearGroupBy
Examples
Row Grouping