TreeNodes.Sort

Syntax

getSort();

setSort (column, method, property, recursive);

Parameters

column. Column number.

method. Sorting option, element of the PP.SortDirection enumeration.

property. Name of the property on which the sorting is based (only for the first column).

recursive. If this parameter is set to true (default), sorting is applied to all child branches, and their settings are reset; if the parameter is false their own sorting methods can be applied to child branches.

Description

The Sort property sets sorting method for the selected column.

Comments

Nodes are sorted after clicking the column heading. The icon appears if the sorting is descending, or the icon if the sorting is ascending.

Example

To execute this example, create a TreeList component named treeList. Add the button clicking which sets ascending sorting for the second column:

function sort()

 {

    treeList.getNodes().setSort(1, PP.SortDirection.asc)

 }

var but = new PP.Ui.Button(

 {

    ParentNode: "but1",

    Content: "Sort"

 });

but.Click.add(sort);

After executing the example, the HTML page houses the Sort button, clicking which sets ascending sorting for values of the second column.

See also:

TreeNodes