SetSortCriteria() method
- Last UpdatedJul 19, 2024
- 1 minute read
Set the sorting criteria by supplying a string of which columns to sort and their order. Then apply the sort criteria. Return false if any error.
Syntax
AlarmClient.SetSortCriteria(SortCriteriaString);
Parameters
SortCriteriaString
The string containing the sorting criteria to be executed.
The syntax of the sort criteria string is: [CriteriaName]:[1|-1];
where:
CriteriaName is the name of the sorting criteria
Colon is separator for sort order integer
Use 1 for Ascending order
Use -1 for Descending order
Semicolon is separator for the next sorting criteria
If ordering integer is not supplied, then default to ascending order
Example
Example1: Sort by time ascending order and then by Priority ascending order
AlarmClient.SetSortCriteria("TimeLCT:1; Priority:1");
Example2: Sort by time ascending order using default value and then by Priority descending order
AlarmClient.SetSortCriteria("TimeLCT; Priority:-1");
Example3: Sort by ascending order in sequence of InAlarm, AckState, Priority, and Time.
AlarmClient.SetSortCriteria("InAlarm;AckState;Priority;TimeLCT");