DataSorter

DataSorter class

Summary description for DataSorter.

Methods

NameDescription
addColorKey()
addKey(key, order)Adds sorted column index and sort order.
addKey(key, order, customList)Adds sorted column index and sort order with 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,
addKey(key, order, customList)Adds sorted column index and sort order with 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. T
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. T
sort(cells, startRow, startColumn, endRow, endColumn)Sorts the data of the area.
sort(cells, area)Sort the data of the area.
sort()Sort the data in the range.

addColorKey()

addKey(key, order)

Adds sorted column index and sort order.

ParameterTypeDescription
keyNumberThe sorted column index(absolute position, column A is 0, B is 1, …)
orderNumberSortOrder

addKey(key, order, customList)

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

ParameterTypeDescription
keyNumberThe sorted column index(absolute position, column A is 0, B is 1, …)
orderNumberSortOrder
customListStringThe 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.

ParameterTypeDescription
keyNumberThe sorted column index(absolute position, column A is 0, B is 1, …)
typeNumberSortOnType
orderNumberSortOrder
customListObjectThe custom sort list.

addKey(key, order, customList)

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

ParameterTypeDescription
keyNumberThe sorted column index(absolute position, column A is 0, B is 1, …)
orderNumberSortOrder
customListArray of StringThe 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)

Sorts the data of the area.

ParameterTypeDescription
cellsCellsThe cells contains the data area.
startRowNumberThe start row of the area.
startColumnNumberThe start column of the area.
endRowNumberThe end row of the area.
endColumnNumberThe end column of the area.

Returns: Array of Number — 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)

Sort the data of the area.

ParameterTypeDescription
cellsCellsThe cells contains the data area.
areaCellAreaThe area needed to sort

Returns: Array of Number — 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()

Sort the data in the range.

Returns: Array of Number — 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.