Methods

addKey(key, order)

Adds sorted column index and sort order.

Parameters

Name Type Optional Description

key

Number

 

The sorted column index(absolute position, column A is 0, B is 1, ...)

order

Number

 

SortOrder

addKey(key, order, customList)

Adds sorted column index and sort order with custom sort list.

Parameters

Name Type Optional Description

key

Number

 

The sorted column index(absolute position, column A is 0, B is 1, ...)

order

Number

 

SortOrder

customList

String

 

The custom sort list.

addKey(key, type, order, customList)

Adds sorted column index and sort order with custom sort list. If type is SortOnType.CellColor or SortOnType.FontColor, the customList is Color.

Parameters

Name Type Optional Description

key

Number

 

The sorted column index(absolute position, column A is 0, B is 1, ...)

type

Number

 

SortOnType

order

Number

 

SortOrder

customList

Object

 

The custom sort list.

addKey(key, order, customList)

Adds sorted column index and sort order with custom sort list.

Parameters

Name Type Optional Description

key

Number

 

The sorted column index(absolute position, column A is 0, B is 1, ...)

order

Number

 

SortOrder

customList

Array of String

 

The custom sort list.

clear()

Clear all settings.

getCaseSensitive()

Gets and sets whether case sensitive when comparing string.

getKey1()

Represents first sorted column index(absolute position, column A is 0, B is 1, ...).

getKey2()

Represents second sorted column index(absolute position, column A is 0, B is 1, ...).

getKey3()

Represents third sorted column index(absolute position, column A is 0, B is 1, ...).

getKeys()

Gets the key list of data sorter.

getOrder1()

Represents sort order of the first key. The value of the property is SortOrder integer constant.

getOrder2()

Represents sort order of the second key. The value of the property is SortOrder integer constant.

getOrder3()

Represents sort order of the third key. The value of the property is SortOrder integer constant.

getSortAsNumber()

Indicates whether sorting anything that looks like a number.

getSortLeftToRight()

True means that sorting orientation is from left to right. False means that sorting orientation is from top to bottom. The default value is false.

hasHeaders()

Represents whether the range has headers.

setCaseSensitive()

Gets and sets whether case sensitive when comparing string.

setHasHeaders()

Represents whether the range has headers.

setKey1()

Represents first sorted column index(absolute position, column A is 0, B is 1, ...).

setKey2()

Represents second sorted column index(absolute position, column A is 0, B is 1, ...).

setKey3()

Represents third sorted column index(absolute position, column A is 0, B is 1, ...).

setOrder1()

Represents sort order of the first key. The value of the property is SortOrder integer constant.

setOrder2()

Represents sort order of the second key. The value of the property is SortOrder integer constant.

setOrder3()

Represents sort order of the third key. The value of the property is SortOrder integer constant.

setSortAsNumber()

Indicates whether sorting anything that looks like a number.

setSortLeftToRight()

True means that sorting orientation is from left to right. False means that sorting orientation is from top to bottom. The default value is false.

sort(cells, startRow, startColumn, endRow, endColumn) → Array of Number

Sorts the data of the area.

Parameters

Name Type Optional Description

cells

Cells

 

The cells contains the data area.

startRow

Number

 

The start row of the area.

startColumn

Number

 

The start column of the area.

endRow

Number

 

The end row of the area.

endColumn

Number

 

The end column of the area.

Returns

Array of Number the original indices(absolute position, for example, column A is 0, B is 1, ...) of the sorted rows/columns. If no rows/columns needs to be moved by this sorting operation, null will be returned.

sort(cells, area) → Array of Number

Sort the data of the area.

Parameters

Name Type Optional Description

cells

Cells

 

The cells contains the data area.

area

CellArea

 

The area needed to sort

Returns

Array of Number the original indices(absolute position, for example, column A is 0, B is 1, ...) of the sorted rows/columns. If no rows/columns needs to be moved by this sorting operation, null will be returned.

sort() → Array of Number

Sort the data in the range.

Returns

Array of Number the original indices(absolute position, for example, column A is 0, B is 1, ...) of the sorted rows/columns. If no rows/columns needs to be moved by this sorting operation, null will be returned.