Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export interface GridTypeBase {
primaryKey?: string;
id?: string;
data: any[] | null;
/* csSuppress */
/** The type of the grid: `'flat'`, `'tree'`, `'hierarchical'`, or `'pivot'`. */
readonly type: 'flat' | 'tree' | 'hierarchical' | 'pivot';
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GridTypeBase is exported from core/src/public_api.ts, so adding a required type property is a TypeScript breaking change for any external code that passes custom objects as GridTypeBase (or implements it) without this field. If the intent is only to improve typing, consider making type optional (and treat undefined as 'flat' internally), or document this as a breaking change with the appropriate changelog/migration steps.

Suggested change
readonly type: 'flat' | 'tree' | 'hierarchical' | 'pivot';
readonly type?: 'flat' | 'tree' | 'hierarchical' | 'pivot';

Copilot uses AI. Check for mistakes.
[key: string]: any;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,6 @@ export interface GridType extends IGridDataBindable {
selectedRows: any[];
/** @hidden @internal */
activeDescendant?: string;
/** @hidden @internal */
readonly type: 'flat' | 'tree' | 'hierarchical' | 'pivot';

toggleGroup?(groupRow: IGroupByRecord): void;
clearGrouping?(field: string): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import { IgxHierarchicalRowComponent } from 'igniteui-angular/grids/hierarchical
import { IgxTreeGridComponent } from 'igniteui-angular/grids/tree-grid';
import { IgxPivotGridComponent } from 'igniteui-angular/grids/pivot-grid';
import { IgxGridNavigationService, IgxPivotNumericAggregate, PivotRowLayoutType } from 'igniteui-angular/grids/core';
import { IgxHierarchicalGridComponent } from 'igniteui-angular/grids/hierarchical-grid';
import { IgxGridComponent } from 'igniteui-angular/grids/grid';
import { FileContentData } from './test-data.service.spec';
import { ZipWrapper } from './zip-verification-wrapper.spec';
Expand Down Expand Up @@ -1729,7 +1728,7 @@ describe('Excel Exporter', () => {
};

const exportAndVerify = async (component, exportOptions, expectedData, exportTable = true) => {
const isHGrid = component instanceof IgxHierarchicalGridComponent;
const isHGrid = component.type === 'hierarchical';
const shouldNotExportTable = isHGrid || !exportTable;

const wrapper = await getExportedData(component, exportOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3097,7 +3097,10 @@ export abstract class IgxGridBaseDirective implements GridType,
*/
public EMPTY_DATA = [];

/** @hidden @internal */
/* csSuppress */
/**
* Returns the type of the grid.
*/
public get type(): GridType["type"] {
return 'flat';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect
@Output()
public dataPreLoad = new EventEmitter<IForOfState>();

/** @hidden @internal */
/* csSuppress */
/**
* Returns the type of the grid.
*/
public override get type(): GridType["type"] {
return 'hierarchical';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,11 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
public get pivotKeys() {
return this.pivotConfiguration.pivotKeys || DEFAULT_PIVOT_KEYS;
}
/** @hidden @internal */

/* csSuppress */
/**
* Returns the type of the grid.
*/
public override get type(): GridType["type"] {
return 'pivot';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,10 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
this.cdr.markForCheck();
}

/** @hidden @internal */
/* csSuppress */
/**
* Returns the type of the grid.
*/
public override get type(): GridType["type"] {
return 'tree';
}
Expand Down
Loading