PivotField
A handle on one pivot field, addressed by its index into the definition’s fields. The table
hands back the same object on every lookup. A cache refresh that reorders the source columns
moves the handle with its column; one that drops the column marks it removed
(isRemoved): it then reports the name it had, no placement and no items, and refuses
mutation. Mutators must run inside PivotManager.update.
Properties
Section titled “Properties”readonly table: PivotTable;Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get axis(): PivotFieldAxis | null;Returns
Section titled “Returns”PivotFieldAxis | null
filters
Section titled “filters”Get Signature
Section titled “Get Signature”get filters(): readonly PivotFieldFilter[];Immutable descriptors, rebuilt on every read. Includes the manual filter synthesized from the field’s hidden items.
Throws
Section titled “Throws”the table is not registered with a pivot manager
Returns
Section titled “Returns”readonly PivotFieldFilter[]
isRemoved
Section titled “isRemoved”Get Signature
Section titled “Get Signature”get isRemoved(): boolean;Returns
Section titled “Returns”boolean
Get Signature
Section titled “Get Signature”get items(): readonly PivotItem[];Throws
Section titled “Throws”the table is not registered with a pivot manager
Returns
Section titled “Returns”readonly PivotItem[]
Get Signature
Section titled “Get Signature”get name(): string;Returns
Section titled “Returns”string
position
Section titled “position”Get Signature
Section titled “Get Signature”get position(): number;Returns
Section titled “Returns”number
showAll
Section titled “showAll”Get Signature
Section titled “Get Signature”get showAll(): boolean;Returns
Section titled “Returns”boolean
sourceName
Section titled “sourceName”Get Signature
Section titled “Get Signature”get sourceName(): string;Returns
Section titled “Returns”string
Methods
Section titled “Methods”clearFilters()
Section titled “clearFilters()”clearFilters(kind?): void;Removes this field’s filters of kind, or all of them when kind is omitted. kind matches
exactly: clearing 'value' leaves a top/bottom filter in place, and vice versa.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Throws
Section titled “Throws”the table is not registered, or is edited outside PivotManager.update
setAxis()
Section titled “setAxis()”setAxis(axis): void;Parameters
Section titled “Parameters”PivotFieldAxis | null
Returns
Section titled “Returns”void
setFilter()
Section titled “setFilter()”setFilter(filter): void;Replaces the filter of the same kind this field already carried. A value filter and a top/bottom filter share one slot in Excel, so setting either one replaces the other.
Parameters
Section titled “Parameters”filter
Section titled “filter”Returns
Section titled “Returns”void
Throws
Section titled “Throws”the table is not registered, is edited outside PivotManager.update, or the
filter names a measure or item this field cannot address, removed handles included
Throws
Section titled “Throws”the condition’s operands are missing or not finite
setName()
Section titled “setName()”setName(name): void;Rejects a caption equal, under excelNameKey, to one that another field of this table stores, because Excel repairs such a workbook by dropping the pivot table. A caption equal to another field’s inherited cache name is allowed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Throws
Section titled “Throws”another field of this table stores an equal caption
setShowAll()
Section titled “setShowAll()”setShowAll(showAll): void;Parameters
Section titled “Parameters”showAll
Section titled “showAll”boolean
Returns
Section titled “Returns”void
setSort()
Section titled “setSort()”setSort(order, by?): void;Sorts by by’s values when a measure is given, by the field’s own labels otherwise. A value
sort addresses its measure by position, so later measure removals renumber it.
Parameters
Section titled “Parameters”"ascending" | "descending"
Returns
Section titled “Returns”void
Throws
Section titled “Throws”the table is not registered, is edited outside PivotManager.update, or by
belongs to another pivot table or was removed