Excel.RangeSort class
管理对象的 Range 排序操作。
属性
| context | 与对象关联的请求上下文。 这将加载项的进程连接到 Office 主机应用程序的进程。 |
方法
| apply(fields, match |
执行排序操作。 |
| apply(fields, match |
执行排序操作。 |
| toJSON() | 覆盖 JavaScript |
属性详细信息
context
方法详细信息
apply(fields, matchCase, hasHeaders, orientation, method)
执行排序操作。
apply(fields: Excel.SortField[], matchCase?: boolean, hasHeaders?: boolean, orientation?: Excel.SortOrientation, method?: Excel.SortMethod): void;
参数
- fields
要用作排序依据的条件列表。
- matchCase
-
boolean
可选。 是否让大小写对字符串排序产生影响。
- hasHeaders
-
boolean
可选。 该区域是否有标头。
- orientation
- Excel.SortOrientation
可选。 该操作是对行还是列排序。
- method
- Excel.SortMethod
可选。 用于中文字符的排序方法。
返回
void
注解
apply(fields, matchCase, hasHeaders, orientation, method)
执行排序操作。
apply(fields: Excel.SortField[], matchCase?: boolean, hasHeaders?: boolean, orientation?: "Rows" | "Columns", method?: "PinYin" | "StrokeCount"): void;
参数
- fields
要用作排序依据的条件列表。
- matchCase
-
boolean
可选。 是否让大小写对字符串排序产生影响。
- hasHeaders
-
boolean
可选。 该区域是否有标头。
- orientation
-
"Rows" | "Columns"
可选。 该操作是对行还是列排序。
- method
-
"PinYin" | "StrokeCount"
可选。 用于中文字符的排序方法。
返回
void
注解
toJSON()
覆盖 JavaScript toJSON() 方法,以便在将 API 对象传递给 JSON.stringify()时提供更有用的输出。 (JSON.stringify反过来调用 toJSON 传递给它的对象的方法。) 虽然原始 Excel.RangeSort 对象是 API 对象, toJSON 但该方法返回一个纯 JavaScript 对象, (类型化为 Excel.Interfaces.RangeSortData) ,其中包含从原始对象加载的任何子属性的浅层副本。
toJSON(): {
[key: string]: string;
};
返回
{ [key: string]: string; }