Need a special offer?Find out if your project fits.
+
API reference
  • API Reference for older versions
  • Table of contents

    sortingMethod

    sortingMethod(uniqueName: 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.

    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

    Custom sorting
    setSort()
    getSort()
    sortValues()
    sortFieldsList()