Get Free Trial
API reference
Table of contents

getFlatSort

getFlatSort(): Array

[starting from version: 2.8.2]

Returns an array of objects defining the sorting on the flat grid.

Note that the getFlatSort method is available only for reports based on "csv", "json", and "api" data source types.

Returns

Array of objects. Each object has the following properties:

  • uniqueName – String. The unique name of the hierarchy being sorted.
  • sort – String. The sorting type ("asc", "desc", or "undefined").

If the flat sorting isn’t specified, or all the sorted hierarchies have the "undefined" sorting type, an empty array is returned.

Example

flexmonster.getFlatSort();

/* method returns array of objects
[
   {uniqueName: "Category", sort: "desc"},
   {uniqueName: "Price", sort: "asc"}
]
*/

Try the example on JSFiddle.

See also

setFlatSort
getSort
setSort
sortingMethod