Class SortSpec

排序规范

排序规范。

方法

方法返回类型简介
getBackgroundColor()Color|null返回用于排序的背景颜色,如果不存在,则返回 null
getDataSourceColumn()DataSourceColumn|null获取排序规范所作用的数据源列。
getDimensionIndex()Integer|null返回维度索引;如果未与本地过滤条件相关联,则返回 null
getForegroundColor()Color|null返回用于排序的前景颜色,如果不存在,则返回 null
getSortOrder()SortOrder返回排序顺序。
isAscending()Boolean返回排序顺序是否为升序。

详细文档

getBackgroundColor()

返回用于排序的背景颜色,如果不存在,则返回 null

返回

Color|null - 背景颜色。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataSourceColumn()

获取排序规范所作用的数据源列。如果此排序规范不针对数据源列,则返回 null

返回

DataSourceColumn|null - 排序规范所作用的数据源列。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDimensionIndex()

返回维度索引;如果未与本地过滤条件相关联,则返回 null

返回

Integer|null - 维度索引。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getForegroundColor()

返回用于排序的前景颜色,如果不存在,则返回 null

返回

Color|null - 前景色。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • 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