setFlatSort(flatSort: Array)
[starting from version: 2.8.2]
Sets the flat table multicolumn sorting.
Note that the setFlatSort
method is available only for reports based on "csv"
, "json"
, and "api"
data source types.
Parameters
Array of objects defining the sorting on the flat grid. 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"
).Note: the hierarchies are sorted in the order they were specified (i.e., the first hierarchy is sorted first, and so on). Therefore, take the element’s order into account when defining the flat table multicolumn sorting. See the example on JSFiddle.
Example
var sort = [
{
uniqueName: "Category",
sort: "desc"
},
{
uniqueName: "Price",
sort: "asc"
}
];
flexmonster.setFlatSort(sort);
Try the example on JSFiddle.
See also