TabSheet.sort

Syntax

sort(columnSettings: Object | Array, sortRange: PP.Ui.TabSheetRange);

Parameters

columnSettings. Sorting parameter or an array of sorting parameters for multiple columns as a JSON object {colIndex, order, comparer}, or an array of such objects where colIndex - index of the sorted column, order - sorting order ('asc' - ascending, 'desc' - descending), comparer - can have a string or number value or have a value as a user-defined function that returns the values 0, 1, or -1.

sortRange. Sorting range.

Description

The sort method sorts table by specified table columns.

Example

To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Sort data of the column with the index 0 in descending order:

// Determine sorting parameters
var params = { colIndex: 0, order: "desc", comparer: "number" };
// Determine cell range
var range = tabSheet.getRange(0, 0, 5, 5);
// Sort data in the column with the index 0
tabSheet.sort(params, range);

After executing the example values of the column with the index 0 are sorted in descending order:

See also:

TabSheet