Gets, sets or removes a sort definition for this column. A sort definition is a column or a list of columns by which data is sorted. A sort definition also contains (in the case of a list of columns) the hierarchy of these sort columns, i.e., the answer to the question by which column the data is sorted first, second...
Returns a struct with two values, index and order. Index is the (1-based) index number of the sort precedence of this column. If data is first sorted by DEPT_NO and then by NAME, the sort precedence of DEPT_NO is 1 and the sort precedence of NAME is 2. Order is a string that is either ASC or DESC. ASC indicates that data is sorted with the lowest value first, DESC indicates that data is sorted with the highest value first.
Returns undefined if no column is selected.
Options is a struct that can have the following items, all of which are optional. You can pass sort-function and order as a direct parameter of .sortOrder(), as opposed to passing it as part of an options struct. Examples 2 and 3 at the end of this help topic illustrate this possibility.
Sort-function is a function that overrides the default sorting functionality. The sorting will be executed on the client. If set to NULL, the function will be removed.
Order is a string that specifies the sort order (ascending or descending). The following values are allowed. Setting order explicitly to the empty string yields has a different meaning than not setting order at all:
Reset is a boolean specifying whether the setting must replace the current sorting. The default is false.
In this example, sort-function is passed as a direct parameter and not as part of an options struct.
In this example, order is passed as a direct parameter and not as part of an options struct.