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 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.
Returns a CellType object that matches the conditions.
Returns a CellType object that matches the conditions.
match any rowID
Returns an array of the current cell selection in the form of [{ column.field: cell.value }, ...].
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>
Sets the child data key of the IgxTreeGridComponent.
<igx-tree-grid #grid [data]="employeeData" [childDataKey]="'employees'" [autoGenerate]="true"></igx-tree-grid>
Gets/Sets the array of data that populates the component.
<igx-tree-grid [data]="Data" [autoGenerate]="true"></igx-tree-grid>
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>
Sets the foreign key of the IgxTreeGridComponent.
<igx-tree-grid #grid [data]="employeeData" [primaryKey]="'employeeID'" [foreignKey]="'parentID'" [autoGenerate]="true">
</igx-tree-grid>
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));
}
Returns an array of processed (filtered and sorted) root ITreeGridRecords.
// gets the processed root record with index=2
const states = this.grid.processedRootRecords[2];
Returns an array of the root level ITreeGridRecords.
// gets the root record with index=2
const states = this.grid.rootRecords[2];
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>
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: