Selectors
Selectors are utility objects that select cells in a pivot to apply styles and sort definitions. Pivots are hierarchical structures, and selectors find the correct cells based on this structure.
You can create the following types of selectors:
-
workbook.ChildNodesSelector – A special type of selector for child nodes. You do not need to use a method to create this type of selector.
-
workbook.DescendantorSelfNodesSelector – A generic selector for many different elements. You do not need to use a method to create this type of selector. Use this selector when you create more specific selectors, such as a path selector.
var myAllSubNodesSelector = workbook.DescendantOrSelfNodesSelector; var myPathSelector = workbook.createPathSelector({ elements: [ myAllSubNodesSelector, workbook.createDimensionSelector({ dimension: myDataDimension }) ] });
-
workbook.DimensionSelector – A selector for dimensions. Use workbook.createDimensionSelector(options) to create this type of selector.
var myDimensionSelector = workbook.createDimensionSelector({ dimension: myDataDimension });
-
workbook.MeasureSelector – A selector for measures. Use workbook.createMeasureSelector(options) to create this type of selector.
var myMeasureSelector = workbook.createMeasureSelector({ measures: [myMeasure] });
-
workbook.MeasureValueSelector – A selector for measure values. Use workbook.createMeasureValueSelector(options) to create this type of selector. When you create this selector, you must provide a column selector, row selector, and measure selector.
var myRowSelector = workbook.DescendantOrSelfNodesSelector; var myColumnSelector = workbook.DescendantOrSelfNodesSelector; var myMeasureSelector = workbook.createMeasureSelector({ measures: [myMeasure] }); var myMeasureValueSelector = workbook.createMeasureValueSelector({ rowSelector: myRowSelector, columnSelector: myColumnSelector, measureSelector: myMeasureSelector });
-
workbook.PathSelector – A selector for paths. Use workbook.createPathSelector(options) to create this type of selector.
var myAllSubNodesSelector = workbook.DescendantOrSelfNodesSelector; var myPathSelector = workbook.createPathSelector({ elements: [ myAllSubNodesSelector, workbook.createDimensionSelector({ dimension: myDimension }) ] });