Class SortSpec
內容詳盡的說明文件
getBackgroundColor()
會傳回用於排序的背景顏色,如果沒有則會傳回 null
。
回攻員
Color
:背景顏色。
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getDataSourceColumn()
取得排序規格要作用的資料來源欄。如果這個排序規格並未對資料來源欄執行操作,則會傳回 null
。
回攻員
DataSourceColumn
:排序規格作用的資料來源欄。
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getDimensionIndex()
傳回維度索引,如果未連結至本機篩選器,則會傳回 null
。
回攻員
Integer
:維度索引。
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getForegroundColor()
傳回用於排序的前景色,如果沒有,則傳回 null
。
回攻員
Color
:前景顏色。
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSortOrder()
傳回排序順序。
回攻員
SortOrder
:排序順序。
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
isAscending()
傳回排序順序是否為遞增。
回攻員
Boolean
:如果排序順序是遞增,則為 true
;否則為 false
。
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-02 (世界標準時間)。
[null,null,["上次更新時間:2024-12-02 (世界標準時間)。"],[[["`SortSpec` defines the specifications for sorting data, such as sort order, colors, and the data source."],["It provides methods to retrieve information about the sort specification, including background and foreground colors, sort order, and the data source column being used."],["You can determine if the sort order is ascending using the `isAscending()` method and obtain the dimension index with `getDimensionIndex()`."],["All methods within `SortSpec` require authorization with specific scopes related to spreadsheet access."]]],["SortSpec defines the criteria for sorting data. Key actions include retrieving the background and foreground colors used in sorting, if any. It fetches the data source column being sorted, or returns null if not present. It can retrieve the dimension index if linked to a filter. The sort order itself, along with whether the sorting is ascending, can also be obtained using the methods `getSortOrder()` and `isAscending()` respectively.\n"]]