Need a special offer?Find out if your project fits.
+
All documentation
API reference
  • API Reference for older versions
  • sortingMethod

    sortingMethod(uniqueName: String, compareFunction: Function)

    [starting from version: 2.6]

    Sets custom sorting for hierarchy members. For more details about defining custom sorting, refer to the Sorting tutorial.

    Parameters

    Parameter/Type Description
    uniqueName
    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.

    Example

    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.

    See also

    Sorting
    setSort()
    getSort()
    sortValues()
    sortFieldsList()