vdl-set-sorter
Define the sort order of a Set entity used within the view. You can specify either a built-in comparator by name, a JavaScript array of ordered values or a custom comparator function.
Example
<vdl-set-sorter set="SetName1" comparator="numeric" direction="desc"></vdl-set-sorter>
<vdl-set-sorter set="SetName2" comparator="=a === 'A04' ? -1 : b === 'A04' ? 1 : a.localeCompare(b)"></vdl-set-sorter>
<vdl-set-sorter set="SetName2" comparator="=['Mon', 'Tue', 'Wed', 'Thu', 'Fri']"></vdl-set-sorter>
Attributes
comparator | Comparator function, expression, sorted array or built-in comparator name. It supports following built-in comparators: "numeric", "string", "boolean", "months", "days". When an expression or a function reference is provided, it will be used to compare two different values in a set in the sorting process. Array form is used to define pre-defined sorting. Scenario data can't be used in expressions for this attribute. | accepts expression | required |
---|---|---|---|
set | Name of the Set entity to sort. | required | |
direction | Direction of sorting to be applied to the Set. Either "asc" or "desc". Defaults to "asc" |