SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.orderBy  method

Sort the columns specified by parameter columns array in order. 

Each item of array can be string or Column Object. And, the columns which are not connected to DataField will be excluded. If want to explicitly specify data field rather than column, you can call orderByFields method. 

If do not specify columns, the existing sorting state will be removed all. 

function orderBy (columns: [GridColumn|String], directions: [SortDirection], textCases: [SortCase]);
Returns
Void
Parameters
columns - [GridColumn|String].
directions - [SortDirection].
textCases - [SortCase].
Code -1
    grid.orderBy(['colName', 'colAddr']);
Code -2
    // Remove sorting state.
    grid.orderBy();
See Also
orderByFields
SortDirection
SortCase
GridColumn
DataField
OperateOptions
Examples
Column Sorting