SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.orderByFields  method

Sort in order of the columns specified by parameter columns array. 

You can specify each field by field index or field name. And, if want to sort by column rather than field, you can call orderBy method. 

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

function orderByFields (fieldNames: Array, directions: Array);
Returns
Void
Parameters
fieldNames - Array.
directions - Array.
Code -1
    grid.orderByFields(['fld_name', 'fld_addr']);
Code -2
    // Remove sorting state.
    grid.orderByFields();
See Also
SortDirection
SortCase
orderBy
DataField
Examples
Column Sorting