sortingMethod(hierarchyName: String, compareFunction: Function)
[starting from version: 2.6]
Sets custom sorting for hierarchy members. For more details about defining custom sort please refer to Custom sorting tutorial.
hierarchyName
– String. The unique name of the hierarchy to which the sorting is applied.compareFunction
– Function. Defines the sort order. The input parameters are the same as for compareFunction
of Array.sort() method.The following example shows sorting with really simple compareFunction
which sorts elements in reverse alphabetical order:
flexmonster.sortingMethod("Category", function (a, b) { return a < b ? 1 : -1; });
Try the example on JSFiddle.
Custom sorting
setSort()
getSort()
sortValues()
sortFieldsList()