Class IgxHierarchicalGridBaseDirective

Base class containing all logic required for implementing DisplayDensity.

Hierarchy

Hierarchy

Implements

  • GridType

Constructors

Properties

Accessors

Methods

Constructors

Properties

activeNodeChange: EventEmitter<IActiveNodeChangeEventArgs> = ...

Emmited when the active node is changed.

Example

<igx-grid [data]="data" [autoGenerate]="true" (activeNodeChange)="activeNodeChange($event)"></igx-grid>
addRowEmptyTemplate: TemplateRef<void>

Gets/Sets a custom template for adding row UI when grid is empty.

Example

<igx-grid [id]="'igx-grid-1'" [data]="Data" [addRowEmptyTemplate]="myTemplate" [autoGenerate]="true"></igx-grid>
advancedFilteringExpressionsTreeChange: EventEmitter<IFilteringExpressionsTree> = ...

Emitted after advanced filtering is performed.

Remarks

Returns the advanced filtering expressions tree.

Example

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

Gets/Sets whether to auto-generate the columns.

Remarks

The default value is false. When set to true, it will override all columns declared through code or in markup.

Example

<igx-grid [data]="Data" [autoGenerate]="true"></igx-grid>
autoGenerateExclude: string[] = []

Gets/Sets a list of property keys to be excluded from the generated column collection

Remarks

The collection is only used during initialization and changing it will not cause any changes in the generated columns at runtime unless the grid is destroyed and recreated. To modify the columns visible in the UI at runtime, please use their hidden property.

Example

<igx-grid data=[Data] [autoGenerate]="true" [autoGenerateExclude]="['ProductName', 'Count']"></igx-grid>
const Data = [{ 'Id': '1', 'ProductName': 'name1', 'Description': 'description1', 'Count': 5 }]
cdr: ChangeDetectorRef
cellClick: EventEmitter<IGridCellEventArgs> = ...

Emitted when a cell is clicked.

Remarks

Returns the IgxGridCell.

Example

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

Emitted when cell has been edited.

Remarks

Event is fired after editing is completed, when the cell is exiting edit mode. This event is cancelable.

Example

<igx-grid #grid3 (cellEdit)="editDone($event)" [data]="data" [primaryKey]="'ProductID'">
</igx-grid>
cellEditDone: EventEmitter<IGridEditDoneEventArgs> = ...

Emitted after cell has been edited and editing has been committed.

Example

<igx-grid #grid3 (cellEditDone)="editDone($event)" [data]="data" [primaryKey]="'ProductID'">
</igx-grid>
cellEditEnter: EventEmitter<IGridEditEventArgs> = ...

Emitted when cell enters edit mode.

Remarks

This event is cancelable.

Example

<igx-grid #grid3 (cellEditEnter)="editStart($event)" [data]="data" [primaryKey]="'ProductID'">
</igx-grid>
cellEditExit: EventEmitter<IGridEditDoneEventArgs> = ...

Emitted when cell exits edit mode.

Example

<igx-grid #grid3 (cellEditExit)="editExit($event)" [data]="data" [primaryKey]="'ProductID'">
</igx-grid>
clipboardOptions: {
    copyFormatters: boolean;
    copyHeaders: boolean;
    enabled: boolean;
    separator: string;
} = ...

Controls the copy behavior of the grid.

Type declaration

  • copyFormatters: boolean

    Apply the columns formatters (if any) on the data in the clipboard output.

  • copyHeaders: boolean

    Include the columns headers in the clipboard output.

  • enabled: boolean

    Enables/disables the copy behavior

  • separator: string

    The separator used for formatting the copy output. Defaults to \t.

colResizingService: IgxColumnResizingService
columnInit: EventEmitter<IgxColumnComponent> = ...

Emitted when a column is initialized.

Remarks

Returns the column object.

Example

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

Emitted during the column moving operation.

Remarks

Returns the source and target IgxColumnComponent objects. This event is cancelable.

Example

<igx-grid (columnMoving)="moving($event)"></igx-grid>
columnMovingEnd: EventEmitter<IColumnMovingEndEventArgs> = ...

Emitted when column moving ends.

Remarks

Returns the source and target IgxColumnComponent objects.

Example

<igx-grid (columnMovingEnd)="movingEnds($event)"></igx-grid>
columnMovingStart: EventEmitter<IColumnMovingStartEventArgs> = ...

Emitted when column moving starts.

Remarks

Returns the moved IgxColumnComponent object.

Example

<igx-grid (columnMovingStart)="movingStart($event)"></igx-grid>
columnPin: EventEmitter<IPinColumnCancellableEventArgs> = ...

Emitted before IgxColumnComponent is pinned.

Remarks

The index at which to insert the column may be changed through the insertAtIndex property.

Example

public columnPinning(event) {
if (event.column.field === "Name") {
event.insertAtIndex = 0;
}
}
columnPinned: EventEmitter<IPinColumnEventArgs> = ...

Emitted after IgxColumnComponent is pinned.

Remarks

The index that the column is inserted at may be changed through the insertAtIndex property.

Example

public columnPinning(event) {
if (event.column.field === "Name") {
event.insertAtIndex = 0;
}
}
columnResized: EventEmitter<IColumnResizeEventArgs> = ...

Emitted after column is resized.

Remarks

Returns the IgxColumnComponent object's old and new width.

Example

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

Emitted when IgxColumnComponent is selected.

Example

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

Emitted after column visibility is changed.

Remarks

Args: { column: IgxColumnComponent, newValue: boolean }

Example

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

Emitted before column visibility is changed.

Remarks

Args: { column: any, newValue: boolean }

Example

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

Emitted when a cell is right clicked.

Remarks

Returns the IgxGridCell object.

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

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

Example

 <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.

Example

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

Emitted when a new chunk of data is loaded from virtualization.

Example

 <igx-hierarchical-grid [id]="'igx-grid-1'" [data]="Data" [autoGenerate]="true" (dataPreLoad)="handleEvent()">
</igx-hierarchical-grid>
densityChanged: EventEmitter<IDensityChangedEventArgs> = ...
document: any
doubleClick: EventEmitter<IGridCellEventArgs> = ...

Emitted when a cell is double clicked.

Remarks

Returns the IgxGridCell object.

Example

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

Gets the row ID that is being dragged.

Remarks

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

emptyFilteredGridTemplate: TemplateRef<any>

A template reference for the template when the filtered grid is empty.

Example

const emptyTempalte = this.grid.emptyGridTemplate;
emptyGridDefaultTemplate: TemplateRef<any>

A template reference for the template when the grid is empty.

Example

const emptyTempalte = this.grid.emptyGridTemplate;
emptyGridTemplate: TemplateRef<void>

Gets/Sets a custom template when empty.

Example

<igx-grid [id]="'igx-grid-1'" [data]="Data" [emptyGridTemplate]="myTemplate" [autoGenerate]="true"></igx-grid>
evenRowCSS: string = 'igx-grid__tr--even'

Deprecated

in version 12.2.0. We suggest using rowClasses property instead

Gets/Sets the styling classes applied to all even IgxGridRowComponents in the grid.

Example

<igx-grid #grid [data]="Data" [evenRowCSS]="'igx-grid--my-even-class'" [autoGenerate]="true"></igx-grid>
excelStyleHeaderIconDirectiveTemplate: TemplateRef<IgxGridHeaderTemplateContext> = null

The custom template, if any, that should be used when rendering a row expand indicator.

expandChildren: boolean
filteredData: any[]
filtering: EventEmitter<IFilteringEventArgs> = ...

Emitted before filtering expressions are applied.

Remarks

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

Example

<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.

Remarks

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

Example

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

Emitted after filtering is performed.

Remarks

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

Example

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

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

Example

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

Emitted when a copy operation is executed.

Remarks

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

gridKeydown: EventEmitter<IGridKeydownEventArgs> = ...

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

Remarks

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.

Example

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

Emitted when grid is scrolled horizontally/vertically.

Example

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

Gets/Sets the key indicating whether a row has children. If row has no children it does not render an expand indicator.

Example

<igx-hierarchical-grid #grid [data]="localData" [hasChildrenKey]="'hasEmployees'">
</igx-hierarchical-grid>
headerCollapseIndicatorTemplate: TemplateRef<IgxGridTemplateContext> = null

The custom template, if any, that should be used when rendering a header collapse indicator.

headerExpandIndicatorTemplate: TemplateRef<IgxGridTemplateContext> = null

The custom template, if any, that should be used when rendering a header expand indicator.

isPivot: boolean = false
loadingGridTemplate: TemplateRef<void>

Gets/Sets a custom template when loading.

Example

<igx-grid [id]="'igx-grid-1'" [data]="Data" [loadingGridTemplate]="myTemplate" [autoGenerate]="true"></igx-grid>
moving: boolean = false

Controls whether columns moving is enabled in the grid.

navigation: IgxGridNavigationService
oddRowCSS: string = 'igx-grid__tr--odd'

Deprecated

in version 12.2.0. We suggest using rowClasses property instead

Gets/Sets the styling classes applied to all odd IgxGridRowComponents in the grid.

Example

<igx-grid #grid [data]="Data" [evenRowCSS]="'igx-grid--my-odd-class'" [autoGenerate]="true"></igx-grid>
pageChange: EventEmitter<number> = ...

Deprecated

in version 12.1.0. Use the corresponding output exposed by the igx-paginator component instead

Emitted after the current page is changed.

Example

<igx-grid (pageChange)="onPageChange($event)"></igx-grid>
public onPageChange(page: number) {
this.currentPage = page;
}
pagingDone: EventEmitter<IPageEventArgs> = ...

Deprecated

in version 12.1.0. Use the corresponding output exposed by the igx-paginator component instead

Emitted after paging is performed.

Remarks

Returns an object consisting of the previous and next pages.

Example

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

Deprecated

in version 12.1.0. Use the corresponding output exposed by the igx-paginator component instead

Emitted when perPage property value of the grid is changed.

Example

<igx-grid #grid (perPageChange)="onPerPageChange($event)" [autoGenerate]="true"></igx-grid>
public onPerPageChange(perPage: number) {
this.perPage = perPage;
}
primaryKey: any

Gets/Sets the primary key.

Example

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

Emitted when making a range selection.

Remarks

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

rootGrid: GridType
rowAdd: EventEmitter<IGridEditEventArgs> = ...

Emmited just before the newly added row is commited.

Remarks

This event is cancelable. Returns an IGridEditEventArgs object.

Example

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

Emitted when a row is added.

Remarks

Returns the data for the new IgxGridRowComponent object.

Example

<igx-grid #grid [data]="localData" (rowAdded)="rowAdded($event)" [height]="'305px'" [autoGenerate]="true"></igx-grid>
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>

Memberof

IgxColumnComponent

rowCollapsedIndicatorTemplate: TemplateRef<IgxGridRowTemplateContext> = null

The custom template, if any, that should be used when rendering a row collapse indicator.

rowDelete: EventEmitter<IGridEditEventArgs> = ...

Emmited when deleting a row.

Remarks

This event is cancelable. Returns an IGridEditEventArgs object.

Example

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

Emitted when a row is deleted.

Remarks

Returns an IRowDataEventArgs object.

Example

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

Emitted when dropping a row.

Remarks

Return the dropped row.

rowDragStart: EventEmitter<IRowDragStartEventArgs> = ...

Emitted when start dragging a row.

Remarks

Return the dragged row.

rowEdit: EventEmitter<IGridEditEventArgs> = ...

Emitted when exiting edit mode for a row.

Remarks

Emitted when [rowEditable]="true" & endEdit(true) is called. Emitted when changing rows during edit mode, selecting an un-editable cell in the edited row, performing paging operation, column resizing, pinning, moving or hitting Done button inside of the rowEditingOverlay, or hitting the Enter key while editing a cell. This event is cancelable.

Example

<igx-grid #grid3 (rowEdit)="editDone($event)" [data]="data" [primaryKey]="'ProductID'" [rowEditable]="true">
</igx-grid>
rowEditDone: EventEmitter<IGridEditDoneEventArgs> = ...

Emitted after exiting edit mode for a row and editing has been committed.

Remarks

Emitted when [rowEditable]="true" & endEdit(true) is called. Emitted when changing rows during edit mode, selecting an un-editable cell in the edited row, performing paging operation, column resizing, pinning, moving or hitting Done button inside of the rowEditingOverlay, or hitting the Enter key while editing a cell.

Example

<igx-grid #grid3 (rowEditDone)="editDone($event)" [data]="data" [primaryKey]="'ProductID'" [rowEditable]="true">
</igx-grid>
rowEditEnter: EventEmitter<IGridEditEventArgs> = ...

Emitted when a row enters edit mode.

Remarks

Emitted when [rowEditable]="true". This event is cancelable.

Example

<igx-grid #grid3 (rowEditEnter)="editStart($event)" [primaryKey]="'ProductID'" [rowEditable]="true">
</igx-grid>
rowEditExit: EventEmitter<IGridEditDoneEventArgs> = ...

Emitted when row editing is canceled.

Remarks

Emits when [rowEditable]="true" & endEdit(false) is called. Emitted when changing hitting Esc key during cell editing and when click on the Cancel button in the row editing overlay.

Example

<igx-grid #grid3 (rowEditExit)="editExit($event)" [data]="data" [primaryKey]="'ProductID'" [rowEditable]="true">
</igx-grid>
rowExpandedIndicatorTemplate: TemplateRef<IgxGridRowTemplateContext> = null

The custom template, if any, that should be used when rendering a row expand indicator.

rowPinned: EventEmitter<IPinRowEventArgs> = ...

Emitted when the pinned state of a row is changed.

Example

<igx-grid [data]="employeeData" (rowPinned)="rowPin($event)" [autoGenerate]="true"></igx-grid>
rowPinning: EventEmitter<IPinRowEventArgs> = ...

Emitted when the pinned state of a row is changed.

Example

<igx-grid [data]="employeeData" (rowPinning)="rowPin($event)" [autoGenerate]="true"></igx-grid>
rowSelectionChanging: EventEmitter<IRowSelectionEventArgs> = ...

Emitted when IgxGridRowComponent is selected.

Example

<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>

Memberof

IgxColumnComponent

rowToggle: EventEmitter<IRowToggleEventArgs> = ...

Emitted when the expanded state of a row gets changed.

Example

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

Emitted when a cell is selected.

Remarks

Returns the IgxGridCell.

Example

<igx-grid #grid (selected)="onCellSelect($event)" [data]="localData" [height]="'305px'" [autoGenerate]="true"></igx-grid>
selectionService: IgxGridSelectionService
shouldGenerate: boolean

Gets/Sets whether the columns should be auto-generated once again after the initialization of the grid

Remarks

This will allow to bind the grid to remote data and having auto-generated columns at the same time. Note that after generating the columns, this property would be disabled to avoid re-creating columns each time a new data is assigned.

Example

 this.grid.shouldGenerate = true;
showExpandAll: boolean = false

Gets/Sets whether the expand/collapse all button in the header should be rendered.

Remark

The default value is false.

Example

<igx-hierarchical-grid #grid [data]="localData" [showExpandAll]="true">
</igx-hierarchical-grid>
snackbarDisplayTime: number = 6000

Gets/Sets the display time for the row adding snackbar notification.

Remarks

By default it is 6000ms.

sortDescendingHeaderIconDirectiveTemplate: TemplateRef<IgxGridHeaderTemplateContext> = null
sorting: EventEmitter<ISortingEventArgs> = ...

Emitted before sorting expressions are applied.

Remarks

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

Example

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

Emitted after sorting is completed.

Remarks

Returns the sorting expression.

Example

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

Emitted before sorting is performed.

Remarks

Returns the sorting expressions.

Example

<igx-grid #grid [data]="localData" [autoGenerate]="true" (sortingExpressionsChange)="sortingExprChange($event)"></igx-grid>
summaryService: IgxGridSummaryService
toolbarExporting: EventEmitter<IGridToolbarExportEventArgs> = ...

Emitted when an export process is initiated by the user.

Example

toolbarExporting(event: IGridToolbarExportEventArgs){
const toolbarExporting = event;
}
uniqueColumnValuesStrategy: ((column: ColumnType, filteringExpressionsTree: IFilteringExpressionsTree, done: ((values: any[]) => void)) => void)

Type declaration

    • (column: ColumnType, filteringExpressionsTree: IFilteringExpressionsTree, done: ((values: any[]) => void)): void
    • Gets/Sets a unique values strategy used by the Excel Style Filtering

      Remarks

      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.

      Example

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

      Parameters

      Returns void

validationStatusChange: EventEmitter<IGridValidationStatusEventArgs> = ...

Emitted when grid's validation status changes.

Example

<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.

Example

<igx-grid #grid validationTrigger='blur'></igx-grid>

Accessors

  • get allowAdvancedFiltering(): boolean
  • Gets/Sets a value indicating whether the advanced filtering is enabled.

    Example

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

    Returns boolean

  • set allowAdvancedFiltering(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get dataRowList(): QueryList<IgxRowDirective>
  • A list of currently rendered IgxGridRowComponent's.

    Example

    const dataList = this.grid.dataRowList;
    

    Returns QueryList<IgxRowDirective>

  • get dataView(): any[]
  • Returns the currently transformed paged/filtered/sorted/grouped/pinned/unpinned row data, displayed in the grid.

    Example

         const dataView = this.grid.dataView;
    

    Returns any[]

  • get defaultHeaderGroupMinWidth(): number
  • Returns the IgxGridHeaderGroupComponent's minimum allowed width.

    Remarks

    Used internally for restricting header group component width. The values below depend on the header cell default right/left padding values.

    Returns number

  • get expansionStates(): Map<any, boolean>
  • Gets/Sets a list of key-value pairs [row ID, expansion state].

    Remarks

    Includes only states that differ from the default one. Supports two-way binding.

    Example

    <igx-grid #grid [data]="data" [(expansionStates)]="model.expansionStates">
    </igx-grid>

    Returns Map<any, boolean>

  • set expansionStates(value: Map<any, boolean>): void
  • Parameters

    • value: Map<any, boolean>

    Returns void

  • get filterCellList(): IgxGridFilteringCellComponent[]
  • A list of all IgxGridFilteringCellComponent.

    Example

    const filterCells = this.grid.filterCellList;
    

    Returns IgxGridFilteringCellComponent[]

  • get filteredSortedData(): any[]
  • Returns an array containing the filtered sorted data.

    Example

    const filteredSortedData = this.grid1.filteredSortedData;
    

    Returns any[]

  • get hasColumnLayouts(): boolean
  • Returns if the IgxGridComponent has column layouts for multi-row layout definition.

    Example

    const layoutGrid = this.grid.hasColumnLayouts;
    

    Returns boolean

  • get hasEditableColumns(): boolean
  • Returns if the IgxGridComponent has editable columns.

    Example

    const editableGrid = this.grid.hasEditableColumns;
    

    Returns boolean

  • get hasMovableColumns(): boolean
  • Returns if the IgxGridComponent has moveable columns.

    Deprecated

    Use IgxGridComponent.moving instead.

    Example

    const movableGrid = this.grid.hasMovableColumns;
    

    Returns boolean

  • get hasSummarizedColumns(): boolean
  • Returns if the IgxGridComponent has summarized columns.

    Example

    const summarizedGrid = this.grid.hasSummarizedColumns;
    

    Returns boolean

  • get headerCellList(): IgxGridHeaderComponent[]
  • A list of all IgxGridHeaderComponent.

    Example

    const headers = this.grid.headerCellList;
    

    Returns IgxGridHeaderComponent[]

  • get headerGroupsList(): IgxGridHeaderGroupComponent[]
  • A list of all IgxGridHeaderGroupComponent.

    Example

    const headerGroupsList = this.grid.headerGroupsList;
    

    Returns IgxGridHeaderGroupComponent[]

  • get hiddenColumnsCount(): number
  • Gets the number of hidden columns.

    Example

    ```typescript const hiddenCol = this.grid.hiddenColumnsCount; ``

    Returns number

  • get isFirstPage(): boolean
  • Deprecated

    in version 12.1.0. Use the corresponding property exposed by the igx-paginator

    Gets if the current page is the first page.

    Example

    const firstPage = this.grid.isFirstPage;
    

    Returns boolean

  • get isLastPage(): boolean
  • Deprecated

    in version 12.1.0. Use the corresponding property exposed by the igx-paginator

    Returns if the current page is the last page.

    Example

    const lastPage = this.grid.isLastPage;
    

    Returns boolean

  • get page(): number
  • Deprecated

    in version 12.1.0. Use page property from igx-paginator component instance instead.

    Gets/Sets the current page index.

    Example

    <!-- old -->
    <igx-grid #grid [data]="Data" [page]="model.page" [autoGenerate]="true"></igx-grid>

    <!-- new -->
    <igx-grid #grid [data]="Data" [autoGenerate]="true">
    <igx-paginator [(page)]="model.page"></igx-paginator>
    </igx-grid>

    Remarks

    Supports two-way binding.

    Returns number

  • set page(val: number): void
  • Parameters

    • val: number

    Returns void

  • get paging(): boolean
  • Deprecated

    in version 12.1.0. Define igx-paginator as a grid child component and paging will be enabled, otherwise disabled.

    Gets/Sets whether the paging feature is enabled.

    Remarks

    The default state is disabled (false).

    Example

    <!-- old -->
    <igx-grid #grid [data]="Data" [paging]="true" [autoGenerate]="true"></igx-grid>

    <!-- new -->
    <igx-grid #grid [data]="Data" [autoGenerate]="true">
    <igx-paginator></igx-paginator>
    </igx-grid>

    Returns boolean

  • set paging(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get perPage(): number
  • Deprecated

    in version 12.1.0. Use perPage property from igx-paginator component instance instead

    Gets/Sets the number of visible items per page.

    Remarks

    The default is 15.

    Example

    <!-- old -->
    <igx-grid #grid [data]="Data" [perPage]="model.perPage" [autoGenerate]="true"></igx-grid>

    <!-- new -->
    <igx-grid #grid [data]="Data" [autoGenerate]="true">
    <igx-paginator [(perPage)]="model.perPage"></igx-paginator>
    </igx-grid>

    Returns number

  • set perPage(val: number): void
  • Parameters

    • val: number

    Returns void

  • get pinnedDataView(): any[]
  • Returns the currently transformed paged/filtered/sorted/grouped pinned row data, displayed in the grid.

    Example

         const pinnedDataView = this.grid.pinnedDataView;
    

    Returns any[]

  • get pinnedWidth(): number
  • Gets the current width of the container for the pinned IgxColumnComponents.

    Example

    const pinnedWidth = this.grid.getPinnedWidth;
    

    Returns number

  • get selectedRows(): any[]
  • Returns any[]

  • set selectedRows(rowIDs: any[]): void
  • Gets/Sets the current selection state.

    Remarks

    Represents the selected rows' IDs (primary key or rowData)

    Example

    <igx-grid [data]="localData" primaryKey="ID" rowSelection="multiple" [selectedRows]="[0, 1, 2]"><igx-grid>
    

    Parameters

    • rowIDs: any[]

    Returns void

  • get showSummaryOnCollapse(): boolean
  • Controls whether the summary row is visible when groupBy/parent row is collapsed.

    Example

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

    Remarks

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

    Returns boolean

  • set showSummaryOnCollapse(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • set sortingOptions(value: ISortingOptions): void
  • Gets/Sets the sorting options - single or multiple sorting. Accepts an ISortingOptions object with any of the mode properties.

    Example

    const _sortingOptions: ISortingOptions = {
    mode: 'single'
    }
    ```html
    <igx-grid [sortingOptions]="sortingOptions"><igx-grid>

    Parameters

    Returns void

  • get totalPages(): number
  • Deprecated

    in version 12.1.0. Use the corresponding property exposed by the igx-paginator

    Gets the total number of pages.

    Example

    const totalPages = this.grid.totalPages;
    

    Returns number

  • get unpinnedDataView(): any[]
  • Returns currently transformed paged/filtered/sorted/grouped unpinned row data, displayed in the grid.

    Example

         const pinnedDataView = this.grid.pinnedDataView;
    

    Returns any[]

  • get unpinnedWidth(): number
  • Gets the current width of the container for the unpinned IgxColumnComponents.

    Example

    const unpinnedWidth = this.grid.getUnpinnedWidth;
    

    Returns number

Methods

  • Enters add mode by spawning the UI under the specified row by rowID.

    Remarks

    If null is passed as rowID, the row adding UI is spawned as the first record in the data view

    Example

    this.grid.beginAddRowById('ALFKI');
    this.grid.beginAddRowById('ALFKI', true);
    this.grid.beginAddRowById(null);

    Parameters

    • rowID: any

      The rowID to spawn the add row UI for, or null to spawn it as the first record in the data view

    • Optional asChild: boolean

      Whether the record should be added as a child. Only applicable to igxTreeGrid.

    Returns void

  • Deselects all rows

    Remarks

    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.

    Example

    this.grid.deselectAllRows();
    

    Parameters

    • onlyFilterData: boolean = true

    Returns void

  • Enables summaries for the specified column and applies your customSummary.

    Remarks

    If you do not provide the customSummary, then the default summary for the column data type will be applied.

    Example

    grid.enableSummaries([{ fieldName: 'ProductName' }, { fieldName: 'ID' }]);
    

    Enable summaries for the listed columns.

    Example

    grid.enableSummaries('ProductName');
    

    Parameters

    • Rest ...rest: any[]

    Returns void

  • Finds the next occurrence of a given string in the grid and scrolls to the cell if it isn't visible.

    Remarks

    Returns how many times the grid contains the string.

    Example

    this.grid.findNext("financial");
    

    Parameters

    • text: string

      the string to search.

    • Optional caseSensitive: boolean

      optionally, if the search should be case sensitive (defaults to false).

    • Optional exactMatch: boolean

      optionally, if the text should match the entire value (defaults to false).

    Returns number

  • Finds the previous occurrence of a given string in the grid and scrolls to the cell if it isn't visible.

    Remarks

    Returns how many times the grid contains the string.

    Example

    this.grid.findPrev("financial");
    

    Parameters

    • text: string

      the string to search.

    • Optional caseSensitive: boolean

      optionally, if the search should be case sensitive (defaults to false).

    • Optional exactMatch: boolean

      optionally, if the text should match the entire value (defaults to false).

    Returns number

  • Returns ICellPosition which defines the next cell, according to the current position, that match specific criteria.

    Remarks

    You can pass callback function as a third parameter of getPreviousCell method. The callback function accepts IgxColumnComponent as a param

    Example

     const nextEditableCellPosition = this.grid.getNextCell(0, 3, (column) => column.editable);
    

    Parameters

    • currRowIndex: number
    • curVisibleColIndex: number
    • callback: ((IgxColumnComponent: any) => boolean) = null
        • (IgxColumnComponent: any): boolean
        • Parameters

          • IgxColumnComponent: any

          Returns boolean

    Returns ICellPosition

  • Returns ICellPosition which defines the previous cell, according to the current position, that match specific criteria.

    Remarks

    You can pass callback function as a third parameter of getPreviousCell method. The callback function accepts IgxColumnComponent as a param

    Example

     const previousEditableCellPosition = this.grid.getPreviousCell(0, 3, (column) => column.editable);
    

    Parameters

    • currRowIndex: number
    • curVisibleColIndex: number
    • callback: ((IgxColumnComponent: any) => boolean) = null
        • (IgxColumnComponent: any): boolean
        • Parameters

          • IgxColumnComponent: any

          Returns boolean

    Returns ICellPosition

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

    Remarks

    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 }, ...].

    Remarks

    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[]

  • 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();

    Example

    grid.markForCheck();
    

    Returns void

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

    Remarks

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

    Example

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

    Parameters

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

          • args: any

          Returns void

    Returns void

  • Pin the row by its id.

    Remarks

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

    Example

    this.grid.pinRow(rowID);
    

    Parameters

    • rowID: any

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

    • Optional index: number

      The index at which to insert the row in the pinned collection.

    • Optional row: RowType

    Returns boolean

  • Selects all rows

    Remarks

    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.

    Example

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

    Parameters

    • onlyFilterData: boolean = true

    Returns void

  • Updates the IgxGridRowComponent and the corresponding data record by primary key.

    Remarks

    Requires that the primaryKey property is set.

    Example

    this.gridWithPK.updateCell('Updated', 1, 'ProductName');
    

    Parameters

    • value: any

      the new value which is to be set.

    • rowSelector: any

      corresponds to rowID.

    • column: string

      corresponds to column field.

    Returns void

  • Updates the IgxGridRowComponent

    Remarks

    The row is specified by rowSelector parameter and the data source record with the passed value. This method will apply requested update only if primary key is specified in the grid.

    Example

    grid.updateRow({
    ProductID: 1, ProductName: 'Spearmint', InStock: true, UnitsInStock: 1, OrderDate: new Date('2005-03-21')
    }, 1);

    Parameters

    • value: any
    • rowSelector: any

      correspond to rowID

    Returns void