Cols.getOrder()
note
This article is about the getOrder() function of the Cols object.
Cols.getOrder()
Gets the current sort order entry of the first column in scope, if that column is currently part of the data source's active sort order.
Returns an object with the column's sort information (its column reference and its 'ASC'/'DESC' order), or undefined if the column is not currently part of the sort order.
Syntax
$.udb( *ds* ).cols( [columns] ).getOrder()
$.udb( *ds* ).rows( [rowRef1], [rowRef2] ).cols( [columns] ).getOrder()
$.udb( *ds* ).rowSet( *rowSet* ).rows( [rowRef1], [rowRef2] ).cols( [columns] ).getOrder()
The required ds parameter is a data source selector.
The optional rowSet parameter is a rowset identifier. If the .rowSet() clause is omitted, then .rowSet('current') is assumed.
The optional rowRef1, rowRef2 are row selectors. If omitted, only the column meta data can be accessed.
The optional columns is a column selector. If omitted, all columns in scope are selected.
Example
let order = $.udb('EMP').cols('NAME').getOrder();
if (order) {
console.log('NAME is sorted %s', order.order);
}