Interface: IFWorksheetSort
Defined in: sheets-sort/src/facade/f-worksheet.ts:23
Methods
sort()
sort(colIndex, asc?): FWorksheet
Defined in: sheets-sort/src/facade/f-worksheet.ts:37
Sort the worksheet by the specified column.
Parameters
Parameter | Type | Description |
---|---|---|
colIndex | number | The column index to sort by. which starts from 1. |
asc ? | boolean | The sort order. true for ascending, false for descending. |
Returns
The worksheet itself for chaining.
Example
const activeSpreadsheet = univerAPI.getActiveWorkbook();
const activeSheet = activeSpreadsheet.getActiveSheet();
activeSheet.sort(1); // Sorts the worksheet by the first column in ascending order.
activeSheet.sort(1, false); // Sorts the worksheet by the first column in descending order.