Class IgxPivotGridComponent

Pivot Grid provides a way to present and manipulate data in a pivot table view.

IgxPivotGridModule

Grids & Lists

pivot, grid, table

igx-grid-theme

The Ignite UI Pivot Grid is used for grouping and aggregating simple flat data into a pivot table. Once data has been bound and the dimensions and values configured it can be manipulated via sorting and filtering.

<igx-pivot-grid [data]="data" [pivotConfiguration]="configuration">
</igx-pivot-grid>

Hierarchy

Hierarchy

  • IgxGridBaseDirective
    • IgxPivotGridComponent

Implements

  • OnInit
  • AfterContentInit
  • GridType
  • AfterViewInit

Constructors

Properties

Accessors

Methods

Constructors

Properties

activeNodeChange: EventEmitter<IActiveNodeChangeEventArgs> = ...

Emmited when the active node is changed.

<igx-grid [data]="data" [autoGenerate]="true" (activeNodeChange)="activeNodeChange($event)"></igx-grid>
advancedFilteringExpressionsTreeChange: EventEmitter<IFilteringExpressionsTree> = ...

Emitted after advanced filtering is performed.

Returns the advanced filtering expressions tree.

<igx-grid #grid [data]="localData" [height]="'305px'" [autoGenerate]="true"
(advancedFilteringExpressionsTreeChange)="advancedFilteringExprTreeChange($event)"></igx-grid>
autoGenerateConfig: boolean = false

Gets/Sets whether to auto-generate the pivot configuration based on the provided data.

The default value is false. When set to true, it will override all dimensions and values in the pivotConfiguration.

<igx-pivot-grid [data]="Data" [autoGenerateConfig]="true"></igx-pivot-grid>
cdr: ChangeDetectorRef

Provides change detection functionality. A change-detection tree collects all views that are to be checked for changes. The property cannot be changed (readonly)

cellClick: EventEmitter<IGridCellEventArgs> = ...

Emitted when a cell is clicked.

Returns the IgxGridCell.

<igx-grid #grid (cellClick)="cellClick($event)" [data]="localData" [height]="'305px'" [autoGenerate]="true"></igx-grid>
clipboardOptions: IClipboardOptions = ...

Controls the copy behavior of the grid.

columnInit: EventEmitter<IgxColumnComponent> = ...

Emitted when a column is initialized.

Returns the column object.

<igx-grid #grid [data]="localData" (columnInit)="initColumns($event)" [autoGenerate]="true"></igx-grid>
columnResized: EventEmitter<IColumnResizeEventArgs> = ...

Emitted after column is resized.

Returns the IgxColumnComponent object's old and new width.

<igx-grid #grid [data]="localData" (columnResized)="resizing($event)" [autoGenerate]="true"></igx-grid>
columnSelectionChanging: EventEmitter<IColumnSelectionEventArgs> = ...

Emitted when IgxColumnComponent is selected.

<igx-grid #grid (columnSelectionChanging)="columnSelectionChanging($event)" [data]="localData" [autoGenerate]="true"></igx-grid>
columnVisibilityChanged: EventEmitter<IColumnVisibilityChangedEventArgs> = ...

Emitted after column visibility is changed.

Args: { column: IgxColumnComponent, newValue: boolean }

<igx-grid (columnVisibilityChanged)="visibilityChanged($event)"></igx-grid>
columnVisibilityChanging: EventEmitter<IColumnVisibilityChangingEventArgs> = ...

Emitted before column visibility is changed.

Args: { column: any, newValue: boolean }

<igx-grid (columnVisibilityChanging)="visibilityChanging($event)"></igx-grid>
contextMenu: EventEmitter<IGridContextMenuEventArgs> = ...

Emitted when a cell or row is right clicked.

Returns the IgxGridCell object if the immediate context menu target is a cell or an IgxGridRow otherwise.

<igx-grid #grid [data]="localData" (contextMenu)="contextMenu($event)" [autoGenerate]="true"></igx-grid>
dataChanged: EventEmitter<any> = ...

Emitted after the grid's data view is changed because of a data operation, rebinding, etc.

 <igx-grid #grid [data]="localData" [autoGenerate]="true" (dataChanged)='handleDataChangedEvent()'></igx-grid>
dataChanging: EventEmitter<IForOfDataChangingEventArgs> = ...

Emitted before the grid's data view is changed because of a data operation, rebinding, etc.

 <igx-grid #grid [data]="localData" [autoGenerate]="true" (dataChanging)='handleDataChangingEvent()'></igx-grid>
dimensionInit: EventEmitter<IPivotDimension> = ...

Emitted when the dimension is initialized.

Emits the dimension that is about to be initialized.

<igx-pivot-grid #grid [data]="localData" [height]="'305px'"
(dimensionInit)="dimensionInit($event)"></igx-pivot-grid>
dimensionsChange: EventEmitter<IDimensionsChange> = ...

Emitted when the dimension collection is changed via the grid chip area.

Returns the new dimension collection and its type:

<igx-pivot-grid #grid [data]="localData" [height]="'305px'"
(dimensionsChange)="dimensionsChange($event)"></igx-grid>
dimensionsSortingExpressionsChange: EventEmitter<ISortingExpression<any>[]> = ...

Emitted when a dimension is sorted.

<igx-pivot-grid #grid [data]="localData" [height]="'305px'"
(dimensionsSortingExpressionsChange)="dimensionsSortingExpressionsChange($event)"></igx-pivot-grid>
doubleClick: EventEmitter<IGridCellEventArgs> = ...

Emitted when a cell is double clicked.

Returns the IgxGridCell object.

<igx-grid #grid [data]="localData" (doubleClick)="dblClick($event)" [autoGenerate]="true"></igx-grid>
emptyGridTemplate: TemplateRef<void>

Gets/Sets a custom template when empty.

<igx-grid [id]="'igx-grid-1'" [data]="Data" [emptyGridTemplate]="myTemplate" [autoGenerate]="true"></igx-grid>
emptyPivotGridTemplate: TemplateRef<void>

Gets/Sets a custom template when pivot grid is empty.

<igx-pivot-grid [emptyPivotGridTemplate]="myTemplate"><igx-pivot-grid>
filtering: EventEmitter<IFilteringEventArgs> = ...

Emitted before filtering expressions are applied.

Returns an IFilteringEventArgs object. filteringExpressions key holds the filtering expressions for the column.

<igx-grid #grid [data]="localData" [height]="'305px'" [autoGenerate]="true" (filtering)="filtering($event)"></igx-grid>
filteringDone: EventEmitter<IFilteringExpressionsTree> = ...

Emitted after filtering is performed through the UI.

Returns the filtering expressions tree of the column for which filtering was performed.

<igx-grid #grid [data]="localData" [height]="'305px'" [autoGenerate]="true" (filteringDone)="filteringDone($event)"></igx-grid>
filteringExpressionsTreeChange: EventEmitter<IFilteringExpressionsTree> = ...

Emitted after filtering is performed.

Returns the filtering expressions tree of the column for which filtering was performed.

<igx-grid #grid [data]="localData" [height]="'305px'" [autoGenerate]="true"
(filteringExpressionsTreeChange)="filteringExprTreeChange($event)"></igx-grid>
formGroupCreated: EventEmitter<IGridFormGroupCreatedEventArgs> = ...

Emitted when formGroup is created on edit of row/cell.

<igx-grid #grid (formGroupCreated)="formGroupCreated($event)" [data]="localData" [height]="'305px'" [autoGenerate]="true"></igx-grid>

Represents the grid service type providing API methods for the grid

gridCopy: EventEmitter<IGridClipboardEvent> = ...

Emitted when a copy operation is executed.

Fired only if copy behavior is enabled through the [clipboardOptions]IgxGridBaseDirective#clipboardOptions.

gridKeydown: EventEmitter<IGridKeydownEventArgs> = ...

Emitted when keydown is triggered over element inside grid's body.

This event is fired only if the key combination is supported in the grid. Return the target type, target object and the original event. This event is cancelable.

 <igx-grid (gridKeydown)="customKeydown($event)"></igx-grid>
gridScroll: EventEmitter<IGridScrollEventArgs> = ...

Emitted when grid is scrolled horizontally/vertically.

<igx-grid #grid [data]="localData" [height]="'305px'" [autoGenerate]="true"
(gridScroll)="onScroll($event)"></igx-grid>
loadingGridTemplate: TemplateRef<void>

Gets/Sets a custom template when loading.

<igx-grid [id]="'igx-grid-1'" [data]="Data" [loadingGridTemplate]="myTemplate" [autoGenerate]="true"></igx-grid>
navigation: IgxGridNavigationService
pivotConfigurationChange: EventEmitter<IPivotConfigurationChangedEventArgs> = ...

Emitted when any of the pivotConfiguration properties is changed via the grid chip area.

<igx-pivot-grid #grid [data]="localData" [height]="'305px'"
(pivotConfigurationChanged)="configurationChanged($event)"></igx-grid>
primaryKey: string

Gets/Sets the primary key.

<igx-grid #grid [data]="localData" [primaryKey]="'ProductID'" [autoGenerate]="true"></igx-grid>
rangeSelected: EventEmitter<GridSelectionRange> = ...

Emitted when making a range selection.

Range selection can be made either through drag selection or through keyboard selection.

rendered: EventEmitter<boolean> = ...

Emitted after the ngAfterViewInit hook. At this point the grid exists in the DOM

rowClasses: any

Sets a conditional class selector to the grid's row element. Accepts an object literal, containing key-value pairs, where the key is the name of the CSS class and the value is either a callback function that returns a boolean, or boolean, like so:

callback = (row: RowType) => { return row.selected > 6; }
rowClasses = { 'className' : this.callback };
<igx-grid #grid [data]="Data" [rowClasses] = "rowClasses" [autoGenerate]="true"></igx-grid>

IgxColumnComponent

rowClick: EventEmitter<IGridRowEventArgs> = ...

Emitted when a row is clicked.

Returns the IgxGridRow.

<igx-grid #grid (rowClick)="rowClick($event)" [data]="localData" [height]="'305px'" [autoGenerate]="true"></igx-grid>
rowDimensionHeaderTemplate: TemplateRef<IgxColumnTemplateContext>
rowSelectionChanging: EventEmitter<IRowSelectionEventArgs> = ...

Emitted when IgxGridRowComponent is selected.

<igx-grid #grid (rowSelectionChanging)="rowSelectionChanging($event)" [data]="localData" [autoGenerate]="true"></igx-grid>
rowStyles: any = null

Sets conditional style properties on the grid row element. It accepts an object literal where the keys are the style properties and the value is an expression to be evaluated.

styles = {
background: 'yellow',
color: (row: RowType) => row.selected : 'red': 'white'
}
<igx-grid #grid [data]="Data" [rowStyles]="styles" [autoGenerate]="true"></igx-grid>

IgxColumnComponent

rowToggle: EventEmitter<IRowToggleEventArgs> = ...

Emitted when the expanded state of a row gets changed.

<igx-grid [data]="employeeData" (rowToggle)="rowToggle($event)" [autoGenerate]="true"></igx-grid>
selected: EventEmitter<IGridCellEventArgs> = ...

Emitted when a cell is selected.

Returns the IgxGridCell.

<igx-grid #grid (selected)="onCellSelect($event)" [data]="localData" [height]="'305px'" [autoGenerate]="true"></igx-grid>
sorting: EventEmitter<ISortingEventArgs> = ...

Emitted before sorting expressions are applied.

Returns an ISortingEventArgs object. sortingExpressions key holds the sorting expressions.

<igx-grid #grid [data]="localData" [autoGenerate]="true" (sorting)="sorting($event)"></igx-grid>
sortingDone: EventEmitter<ISortingExpression<any> | ISortingExpression<any>[]> = ...

Emitted after sorting is completed.

Returns the sorting expression.

<igx-grid #grid [data]="localData" [autoGenerate]="true" (sortingDone)="sortingDone($event)"></igx-grid>
sortingExpressionsChange: EventEmitter<ISortingExpression<any>[]> = ...

Emitted before sorting is performed.

Returns the sorting expressions.

<igx-grid #grid [data]="localData" [autoGenerate]="true" (sortingExpressionsChange)="sortingExprChange($event)"></igx-grid>
uniqueColumnValuesStrategy: ((column: ColumnType, filteringExpressionsTree: IFilteringExpressionsTree, done: ((values: any[]) => void)) => void)

Gets/Sets a unique values strategy used by the Excel Style Filtering

Provides a callback for loading unique column values on demand. If this property is provided, the unique values it generates will be used by the Excel Style Filtering.

<igx-grid [data]="localData" [filterMode]="'excelStyleFilter'" [uniqueColumnValuesStrategy]="columnValuesStrategy"></igx-grid>

Type declaration

    • (column, filteringExpressionsTree, done): void
    • Parameters

      Returns void

validation: IgxGridValidationService

Represents the validation service for the grid. The type contains properties and methods (logic) for validating records

validationStatusChange: EventEmitter<IGridValidationStatusEventArgs> = ...

Emitted when grid's validation status changes.

<igx-grid #grid (validationStatusChange)="validationStatusChange($event)" [data]="localData" [height]="'305px'" [autoGenerate]="true"></igx-grid>
validationTrigger: GridValidationTrigger = 'change'

Gets/Sets the trigger for validators used when editing the grid.

<igx-grid #grid validationTrigger='blur'></igx-grid>
valueChipTemplate: TemplateRef<IgxPivotGridValueTemplateContext>

Gets/Sets a custom template for the value chips.

<igx-pivot-grid [valueChipTemplate]="myTemplate"><igx-pivot-grid>
valueInit: EventEmitter<IPivotValue> = ...

Emitted when the value is initialized.

Emits the value that is about to be initialized.

<igx-pivot-grid #grid [data]="localData" [height]="'305px'"
(valueInit)="valueInit($event)"></igx-pivot-grid>
valuesChange: EventEmitter<IValuesChange> = ...

Emitted when the values collection is changed via the grid chip area.

Returns the new dimension

<igx-pivot-grid #grid [data]="localData" [height]="'305px'"
(valuesChange)="valuesChange($event)"></igx-grid>

Accessors

  • set batchEditing(_val): void
  • Gets/Sets whether the grid has batch editing enabled. When batch editing is enabled, changes are not made directly to the underlying data. Instead, they are stored as transactions, which can later be committed w/ the commit method.

    <igx-grid [batchEditing]="true" [data]="someData">
    </igx-grid>

    Parameters

    • _val: boolean

    Returns void

  • set showSummaryOnCollapse(_value): void
  • Controls whether the summary row is visible when groupBy/parent row is collapsed.

    <igx-grid #grid [data]="localData" [showSummaryOnCollapse]="true" [autoGenerate]="true"></igx-grid>
    

    By default showSummaryOnCollapse is set to 'false' which means that the summary row is not visible when the groupBy/parent row is collapsed.

    Parameters

    • _value: boolean

    Returns void

Methods

  • If name is provided, clears the filtering state of the corresponding IgxColumnComponent.

    Otherwise clears the filtering state of all IgxColumnComponents.

    this.grid.clearFilter();
    

    Parameters

    • name: string

    Returns void

  • Deselects all rows

    By default if filtering is in place, selectAllRows() and deselectAllRows() select/deselect all filtered rows. If you set the parameter onlyFilterData to false that will deselect all rows in the grid exept deleted rows.

    this.grid.deselectAllRows();
    

    Parameters

    • onlyFilterData: boolean = true

    Returns void

  • Filters all the IgxColumnComponent in the IgxGridComponent with the same condition.

    grid.filterGlobal('some', IgxStringFilteringOperand.instance().condition('contains'));
    

    Parameters

    • value: any
    • condition: any
    • ignoreCase: any

    Returns void

  • Returns the data that is contained in the row component.

    If the primary key is not specified the row selector match the row data.

    const data = grid.getRowData(94741);
    

    Parameters

    • rowSelector: any

      correspond to rowID

    Returns any

  • Returns an array of the current columns selection in the form of [{ column.field: cell.value }, ...].

    If formatters is enabled, the cell value will be formatted by its respective column formatter (if any). If headers is enabled, it will use the column header (if any) instead of the column field.

    Parameters

    • formatters: boolean = false
    • headers: boolean = false

    Returns any[]

  • Returns an array of the current cell selection in the form of [{ column.field: cell.value }, ...].

    If formatters is enabled, the cell value will be formatted by its respective column formatter (if any). If headers is enabled, it will use the column header (if any) instead of the column field.

    Parameters

    • formatters: boolean = false
    • headers: boolean = false

    Returns any[]

  • Inserts dimension in target collection by type at specified index or at the collection's end.

    this.grid.insertDimensionAt(dimension, PivotDimensionType.Row, 1);
    

    Parameters

    • dimension: IPivotDimension

      The dimension that will be added.

    • targetCollectionType: PivotDimensionType

      The target collection type to add to. Can be Row, Column or Filter.

    • index: number

      The index in the collection at which to add. This parameter is optional. If not set it will add it to the end of the collection.

    Returns void

  • Triggers change detection for the IgxGridComponent. Calling markForCheck also triggers the grid pipes explicitly, resulting in all updates being processed. May degrade performance if used when not needed, or if misused:

    // DON'Ts:
    // don't call markForCheck from inside a loop
    // don't call markForCheck when a primitive has changed
    grid.data.forEach(rec => {
    rec = newValue;
    grid.markForCheck();
    });

    // DOs
    // call markForCheck after updating a nested property
    grid.data.forEach(rec => {
    rec.nestedProp1.nestedProp2 = newValue;
    });
    grid.markForCheck();
    grid.markForCheck();
    

    Returns void

  • Move dimension from its currently collection to the specified target collection by type at specified index or at the collection's end.

    this.grid.moveDimension(dimension, PivotDimensionType.Row, 1);
    

    Parameters

    • dimension: IPivotDimension

      The dimension that will be moved.

    • targetCollectionType: PivotDimensionType

      The target collection type to move it to. Can be Row, Column or Filter.

    • index: number

      The index in the collection at which to add. This parameter is optional. If not set it will add it to the end of the collection.

    Returns void

  • Navigates to a position in the grid based on provided rowindex and visibleColumnIndex.

    Also can execute a custom logic over the target element, through a callback function that accepts { targetType: GridKeydownTargetType, target: Object }

     this.grid.navigateTo(10, 3, (args) => { args.target.nativeElement.focus(); });
    

    Parameters

    • rowIndex: number
    • visibleColIndex: number = -1
    • cb: ((args: any) => void) = null
        • (args): void
        • Parameters

          • args: any

          Returns void

    Returns void

  • Selects all rows

    By default if filtering is in place, selectAllRows() and deselectAllRows() select/deselect all filtered rows. If you set the parameter onlyFilterData to false that will select all rows in the grid exept deleted rows.

    this.grid.selectAllRows();
    this.grid.selectAllRows(false);

    Parameters

    • onlyFilterData: boolean = true

    Returns void

  • Toggles the row by its id.

    ID is either the primaryKey value or the data record instance.

    this.grid.toggleRow(rowID);
    

    Parameters

    • rowID: any

      The row id - primaryKey value or the data record instance.

    Returns void