GcSpread.Sheets Namespace > Sheet type : sortRange Method |
true
to sort by rows, and false
to sort by columns.
The following settings are available:
sortInfo.index | number type | The index of the column or row on which to sort. |
sortInfo.ascending | boolean type | Whether the sort order is ascending. |
var instance = new GcSpread.Sheets.Sheet(name); var value; // Type: boolean value = instance.sortRange(row, column, rowCount, columnCount, byRows, sortInfo);
true
to sort by rows, and false
to sort by columns.The following settings are available:
sortInfo.index | number type | The index of the column or row on which to sort. |
sortInfo.ascending | boolean type | Whether the sort order is ascending. |
true
if the data is sorted successfully; otherwise, false
.sheet.setValue(0,0,"112"); sheet.setValue(1,0,"10"); sheet.setValue(2,0,"223"); sheet.setValue(3,0,"20"); sheet.setValue(4,0,"334"); sheet.setValue(5,0,"30"); sheet.sortRange(0, 0, 6, 1, true, [ {index:0, ascending:true} ]);