setSort (wbk, sortingEnabled, reverseHeader, direction, column, callback);
wbk. Sets workbook, an instance of the Workbook class.
sortingEnabled. Indicates if sorting is enabled.
reverseHeader. Determines order of calendar elements.
direction. Sets sorting direction.
column. Sets sorting column.
callback. Sets operation end handler.
The setSort method sets workbook series sorting.
The reverseHeader parameter may take the following values:
False - direct date order (ascending).
True - reverse date order (descending).
To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and also add the following code in the handler, that processes document opening event:
var setSortButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Set Sorting", //text Click: PP.Delegate(onClickSetSort) }); function onClickSetSort() { var wbk = args.Workbook; var sortingEnabled = True; var reverseHeader = True; var direction = 'west'; var column = 0; tsService.setSort(wbk, sortingEnabled, reverseHeader, direction, column, PP.Delegate(onSetSort,this)); //setSort method execution end handler function onSetSort(sender, args){ workbookBox.refreshAll(); } }
After executing the example the WorkbookBox component and a button named Set Sorting are placed in the HTML page. After clicking this button workbook series will be sorted by date in descending order:
See also: