SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.linearizeColumns  method

Remove column grouping among the columns being displayed in grid and arrange the columns in a row in order. 

You can set properties which will be the sorting criteria in sortProps parameter. If do not specify sortProps, it will sort in order of being created when set columns, and if reverse is true, it will sort in reverse order. Internally, it will create ColumnLayout in which only contains the last columns rather than column group and set it as columnLayout

function linearizeColumns (sortProps: [String], reverse: Boolean);
Returns
Void
Parameters
sortProps - [String].
reverse - Boolean.
Code -1
    $('#linearize').click(function () {
        // Sort in column name order and arrange in a row.
        grid.linearizeColumns(['name']);
        
        // Sort in reverse order of being created.
        grid.linearizeColumns(null, true);
    });
See Also
columnLayout
ColumnGroup
ColumnLayout
Examples
Column Grouping
Column Layouts