Emmited when the active node is changed.
Gets/Sets a custom template for adding row UI when grid is empty.
Emitted after advanced filtering is performed.
Gets/Sets whether to auto-generate the columns.
Gets/Sets a list of property keys to be excluded from the generated column collection
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.
Sets whether child records should be deleted when their parent gets deleted. By default it is set to true and deletes all children along with the parent.
<igx-tree-grid [data]="employeeData" [primaryKey]="'employeeID'" [foreignKey]="'parentID'" cascadeOnDelete="false">
</igx-tree-grid>
Readonly
cdrProvides change detection functionality. A change-detection tree collects all views that are to be checked for changes. The property cannot be changed (readonly)
Emitted when a cell is clicked.
Emitted when cell has been edited.
Emitted after cell has been edited and editing has been committed.
Emitted when cell enters edit mode.
Emitted when cell exits edit mode.
Sets the child data key of the IgxTreeGridComponent
.
<igx-tree-grid #grid [data]="employeeData" [childDataKey]="'employees'" [autoGenerate]="true"></igx-tree-grid>
Controls the copy behavior of the grid.
Emitted when a column is initialized.
Emitted during the column moving operation.
Emitted when column moving ends.
Emitted when column moving starts.
Emitted before IgxColumnComponent
is pinned.
Emitted after IgxColumnComponent
is pinned.
Emitted after column is resized.
Emitted when IgxColumnComponent
is selected.
Emitted after column visibility is changed.
Emitted before column visibility is changed.
Emitted when a cell or row is right clicked.
Emitted after the grid's data view is changed because of a data operation, rebinding, etc.
Emitted before the grid's data view is changed because of a data operation, rebinding, etc.
Emitted when a cell is double clicked.
Gets/Sets a custom template when empty.
Emitted before filtering expressions are applied.
Emitted after filtering is performed through the UI.
Emitted after filtering is performed.
Sets the foreign key of the IgxTreeGridComponent
.
<igx-tree-grid #grid [data]="employeeData" [primaryKey]="'employeeID'" [foreignKey]="'parentID'" [autoGenerate]="true">
</igx-tree-grid>
Emitted when formGroup is created on edit of row/cell.
Readonly
gridAPIRepresents the grid service type providing API methods for the grid
Emitted when a copy operation is executed.
Fired only if copy behavior is enabled through the [clipboardOptions
]IgxGridBaseDirective#clipboardOptions.
Emitted when keydown is triggered over element inside grid's body.
Emitted when grid is scrolled horizontally/vertically.
Sets the key indicating whether a row has children. This property is only used for load on demand scenarios.
<igx-tree-grid #grid [data]="employeeData" [primaryKey]="'employeeID'" [foreignKey]="'parentID'"
[loadChildrenOnDemand]="loadChildren"
[hasChildrenKey]="'hasEmployees'">
</igx-tree-grid>
Sets the value of the id
attribute. If not provided it will be automatically generated.
<igx-tree-grid [id]="'igx-tree-grid-1'"></igx-tree-grid>
Sets a callback for loading child rows on demand.
<igx-tree-grid [data]="employeeData" [primaryKey]="'employeeID'" [foreignKey]="'parentID'" [loadChildrenOnDemand]="loadChildren">
</igx-tree-grid>
public loadChildren = (parentID: any, done: (children: any[]) => void) => {
this.dataService.getData(parentID, children => done(children));
}
Gets/Sets a custom template when loading.
Controls whether columns moving is enabled in the grid.
Returns a map of all processed (filtered and sorted) ITreeGridRecord
s.
// gets the processed record with primaryKey=2
const states = this.grid.processedRecords.get(2);
Returns an array of processed (filtered and sorted) root ITreeGridRecord
s.
// gets the processed root record with index=2
const states = this.grid.processedRootRecords[2];
Emitted when making a range selection.
Returns a map of all ITreeGridRecord
s.
// gets the record with primaryKey=2
const states = this.grid.records.get(2);
Emitted after the ngAfterViewInit hook. At this point the grid exists in the DOM
Returns an array of the root level ITreeGridRecord
s.
// gets the root record with index=2
const states = this.grid.rootRecords[2];
Emmited just before the newly added row is commited.
Emitted when a row is added.
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>
Emitted when a row is clicked.
Emmited when deleting a row.
Emitted when a row is deleted.
Emitted when dropping a row.
Emitted when start dragging a row.
Emitted when exiting edit mode for a row.
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.
Emitted after exiting edit mode for a row and editing has been committed.
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.
Emitted when a row enters edit mode.
Emitted when row editing is canceled.
Emitted when the pinned state of a row is changed.
Emitted when the pinned state of a row is changed.
Emitted when IgxGridRowComponent
is selected.
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>
Emitted when the expanded state of a row gets changed.
Emitted when a cell is selected.
Gets/Sets the display time for the row adding snackbar notification.
Emitted before sorting expressions are applied.
Emitted after sorting is completed.
Emitted before sorting is performed.
Emitted when an export process is initiated by the user.
Gets/Sets a unique values strategy used by the Excel Style Filtering
Readonly
validationRepresents the validation service for the grid. The type contains properties and methods (logic) for validating records
Emitted when grid's validation status changes.
Gets/Sets the trigger for validators used when editing the grid.
Gets/Sets the advanced filtering state.
Gets/Sets a value indicating whether the advanced filtering is enabled.
Gets/Sets if the filtering is enabled.
Indicates whether filtering in the grid is enabled. If te value is true, the grid can be filtered
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.
Gets/Sets cell selection mode.
Represents the selection mode for cells: 'none','single', 'multiple', 'multipleCascade'
Gets an array of IgxColumnComponent
s.
Gets/Sets column selection mode
Represents the selection mode for columns: 'none','single', 'multiple', 'multipleCascade'
Gets/Sets the default width of the columns.
Gets/Sets the array of data that populates the component.
<igx-tree-grid [data]="Data" [autoGenerate]="true"></igx-tree-grid>
Gets/Sets the data clone strategy of the grid when in edit mode.
Strategy, used for cloning the provided data. The type has one method, that takes any type of data
A list of currently rendered IgxGridRowComponent
's.
Returns the currently transformed paged/filtered/sorted/grouped/pinned/unpinned row data, displayed in the grid.
Returns the IgxGridHeaderGroupComponent
's minimum allowed width.
Gets the default row height.
Gets the custom template, if any, used for row drag ghost.
Sets a custom template for the row drag ghost.
<ng-template #template igxRowDragGhost>
<igx-icon>menu</igx-icon>
</ng-template>
@ViewChild("'template'", {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.dragGhostCustomTemplate = this.template;
The custom template, if any, that should be used when rendering the row drag indicator icon
Sets a custom template that should be used when rendering the row drag indicator icon.
<ng-template #template igxDragIndicatorIcon>
<igx-icon>expand_less</igx-icon>
</ng-template>
@ViewChild("'template'", {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.dragIndicatorIconTemplate = this.template;
Gets/Sets the message displayed when there are no records and the grid is filtered.
Get/Sets the message displayed when there are no records.
Gets the excel style header icon.
Sets the excel style header icon.
<ng-template #template igxExcelStyleHeaderIcon>
<igx-icon>filter_alt</igx-icon>
</ng-template>
@ViewChild('template', {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.excelStyleHeaderIconTemplate = this.template;
Sets the count of levels to be expanded in the IgxTreeGridComponent
. By default it is
set to Infinity
which means all levels would be expanded.
<igx-tree-grid #grid [data]="employeeData" [childDataKey]="'employees'" expansionDepth="1" [autoGenerate]="true"></igx-tree-grid>
Gets/Sets a list of key-value pairs [row ID, expansion state].
Returns an array of objects containing the filtered data.
Returns an array containing the filtered sorted data.
Gets/Sets the filtering state.
Gets/Sets the filtering logic of the IgxGridComponent
.
Gets/Sets the filter mode.
The filter mode for the grid. It can be quick filter of excel-style filter
Gets/Sets the filtering strategy of the grid.
Indicates whether the grid has columns that are shown
Gets the row collapse indicator template.
Sets the row collapse indicator template.
<ng-template igxHeaderCollapsedIndicator>
<igx-icon role="button">add</igx-icon>
</ng-template>
@ViewChild('template', {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.headerCollapsedIndicatorTemplate = this.template;
Gets the header expand indicator template.
Sets the header expand indicator template.
<ng-template igxHeaderExpandedIndicator>
<igx-icon role="button">remove</igx-icon>
</ng-template>
@ViewChild('template', {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.headerExpandedIndicatorTemplate = this.template;
Gets the header row selector template.
Sets the header row selector template.
<ng-template #template igxHeadSelector let-headContext>
{{ headContext.selectedCount }} / {{ headContext.totalCount }}
</ng-template>
@ViewChild("'template'", {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.headSelectorTemplate = this.template;
Gets/Sets the height.
Gets the number of hidden columns.
Gets/Sets if the row selectors are hidden.
Gets/Sets whether the grid is going to show a loading indicator.
Represents the last search information.
Gets/Sets the locale.
Represents the locale of the grid: USD
, EUR
, GBP
, CNY
, JPY
, etc.
Gets the native element.
Gets/Sets the outlet used to attach the grid's overlays to.
Represents the paging of the grid. It can be either 'Local' or 'Remote'
Represents the paging of the grid. It can be either 'Local' or 'Remote'
Gets an array of the pinned IgxColumnComponent
s.
Gets the number of pinned columns.
Gets an array of the pinned IgxRowComponent
s.
Gets/Sets the initial pinning configuration.
The configuration for columns and rows pinning in the grid It's of type IPinningConfig, which can have value for columns (start, end) and for rows (top, bottom)
Gets/Sets the primary key.
Represents the unique primary key used for identifying rows in the grid
Gets/Sets the resource strings.
Gets the row add text template.
Sets the row add text template.
<ng-template #template igxRowAddText>
Adding Row
</ng-template>
@ViewChild('template', {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.rowAddTextTemplate = this.template;
Gets the row collapse indicator template.
Sets the row collapse indicator template.
<ng-template igxRowCollapsedIndicator>
<igx-icon role="button">add</igx-icon>
</ng-template>
@ViewChild('template', {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.rowCollapsedIndicatorTemplate = this.template;
Gets/Sets whether rows can be moved.
Indicates whether rows in the grid can be dragged. If te value is true, the rows can be dragged
Gets/Sets whether the rows are editable.
Indicates whether rows in the grid are editable. If te value is true, the rows can be edited
Gets the row edit actions template.
Sets the row edit actions template.
<ng-template #template igxRowEditActions let-endRowEdit>
<button type="button" igxButton igxRowEditTabStop (click)="endRowEdit(false)">Cancel</button>
<button type="button" igxButton igxRowEditTabStop (click)="endRowEdit(true)">Apply</button>
</ng-template>
@ViewChild('template', {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.rowEditActionsTemplate = this.template;
Gets the row edit text template.
Sets the row edit text template.
<ng-template #template igxRowEditText let-rowChangesCount>
Changes: {{rowChangesCount}}
</ng-template>
@ViewChild('template', {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.rowEditTextTemplate = this.template;
Gets the row expand indicator template.
Sets the row expand indicator template.
<ng-template igxRowExpandedIndicator>
<igx-icon role="button">remove</igx-icon>
</ng-template>
@ViewChild('template', {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.rowExpandedIndicatorTemplate = this.template;
Gets/Sets the row height.
The height of each row in the grid. Setting a constant height can solve problems with not showing all elements when scrolling
A list of IgxGridRowComponent
.
Template for the row loading indicator when load on demand is enabled.
<ng-template #rowLoadingTemplate>
<igx-icon>loop</igx-icon>
</ng-template>
<igx-tree-grid #grid [data]="employeeData" [primaryKey]="'ID'" [foreignKey]="'parentID'"
[loadChildrenOnDemand]="loadChildren"
[rowLoadingIndicatorTemplate]="rowLoadingTemplate">
</igx-tree-grid>
Optional The template for row loading indicators. It is of type TemplateRef, which represents an embedded template, used to instantiate embedded views
Gets/Sets row selection mode
Represents the selection mode for rows: 'none','single', 'multiple', 'multipleCascade'
Gets the row selector template.
Sets a custom template for the row selectors.
<ng-template #template igxRowSelector let-rowContext>
<igx-checkbox [checked]="rowContext.selected"></igx-checkbox>
</ng-template>
@ViewChild("'template'", {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.rowSelectorTemplate = this.template;
Gets/Sets the current selection state.
Gets/Sets whether clicking over a row should select/deselect it
Gets/Sets whether the columns should be auto-generated once again after the initialization of the grid
Controls whether the summary row is visible when groupBy/parent row is collapsed.
The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in asc order.
Sets a custom template that should be used when rendering a header sorting indicator when columns are sorted in asc order.
<ng-template #template igxSortAscendingHeaderIcon>
<igx-icon>expand_less</igx-icon>
</ng-template>
@ViewChild("'template'", {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.sortAscendingHeaderIconTemplate = this.template;
The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in desc order.
Sets a custom template that should be used when rendering a header sorting indicator when columns are sorted in desc order.
<ng-template #template igxSortDescendingHeaderIcon>
<igx-icon>expand_more</igx-icon>
</ng-template>
@ViewChild("'template'", {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.sortDescendingHeaderIconTemplate = this.template;
Gets custom template, if any, that should be used when rendering a header sorting indicator when columns are not sorted.
Sets a custom template that should be used when rendering a header sorting indicator when columns are not sorted.
<ng-template #template igxSortHeaderIcon>
<igx-icon>unfold_more</igx-icon>
</ng-template>
@ViewChild("'template'", {read: TemplateRef })
public template: TemplateRef<any>;
this.grid.sortHeaderIconTemplate = this.template;
Gets/Sets the sorting state.
Gets/Sets the sorting options - single or multiple sorting.
Accepts an ISortingOptions
object with any of the mode
properties.
Gets/Sets the sorting strategy of the grid.
Gets/Sets the summary calculation mode.
Represents the calculation mode for summaries: 'rootLevelOnly', 'childLevelsOnly', 'rootAndChildLevels'
Gets/Sets the summary position.
Represents the position of summaries: 'top', 'bottom'
Get/Set IgxSummaryRow height
Returns the total number of records.
Gets an array of unpinned IgxColumnComponent
s.
Returns the state of the grid virtualization.
Returns an array of visible IgxColumnComponent
s.
Gets/Sets the width of the grid.
Creates a new IgxTreeGridRowComponent
with the given data. If a parentRowID is not specified, the newly created
row would be added at the root level. Otherwise, it would be added as a child of the row whose primaryKey matches
the specified parentRowID. If the parentRowID does not exist, an error would be thrown.
const record = {
ID: this.grid.data[this.grid1.data.length - 1].ID + 1,
Name: this.newRecord
};
this.grid.addRow(record, 1); // Adds a new child row to the row with ID=1.
Enters add mode by spawning the UI under the specified row by rowID.
The rowID to spawn the add row UI for, or null to spawn it as the first record in the data view
Whether the record should be added as a child. Only applicable to igxTreeGrid.
Enters add mode by spawning the UI with the context of the specified row by index.
The index to spawn the UI at. Accepts integers from 0 to this.grid.dataView.length
Whether the record should be added as a child. Only applicable to igxTreeGrid.
Deselect specified columns by field.
Filters a single IgxColumnComponent
.
Finds the next occurrence of a given string in the grid and scrolls to the cell if it isn't visible.
the string to search.
optionally, if the search should be case sensitive (defaults to false).
optionally, if the text should match the entire value (defaults to false).
Finds the previous occurrence of a given string in the grid and scrolls to the cell if it isn't visible.
the string to search.
optionally, if the search should be case sensitive (defaults to false).
optionally, if the text should match the entire value (defaults to false).
Returns the IgxColumnComponent
by field name.
Gets the width
to be set on IgxGridHeaderGroupComponent
.
Returns ICellPosition
which defines the next cell,
according to the current position, that match specific criteria.
Returns ICellPosition
which defines the previous cell,
according to the current position, that match specific criteria.
Get the currently selected ranges in the grid.
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();
Places a column before or after the specified target column.
Opens the advanced filtering dialog.
Pins a column by field name.
Select specified columns.
if true clears the current selection
Get current selected columns.
Select range(s) of cells between certain rows and columns of the grid.
Sort a single IgxColumnComponent
.
Unpins a column by field name. Returns whether the operation is successful.
Ignite UI for Angular Tree Grid - Documentation
The Ignite UI Tree Grid displays and manipulates hierarchical data with consistent schema formatted as a table and provides features such as sorting, filtering, editing, column pinning, paging, column moving and hiding.
Example: