-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Labels
Description
Description
IgxGridLiteColumnConfiguration is defined as a generic type, requiring an explicit model type (e.g. IgxGridLiteColumnConfiguration<ProductInfo>).
Using the type without a generic argument (IgxGridLiteColumnConfiguration[]) results in a TypeScript error, even when the grid data and columns clearly target a single known data model.
- igniteui-angular version: ^21.1.0-rc.1
- browser: Chrome
Steps to reproduce
- Define your columns list like this
public columns: IgxGridLiteColumnConfiguration[] = [
{ field: 'id', header: 'ID', hidden: true, resizable: true, sortable: false, filterable: false, dataType: 'string'},
{ field: 'name', header: 'Product Name', hidden: false, resizable: true, sortable: false, filterable: false, dataType: 'string'},
{ field: 'price', header: 'Price', hidden: false, resizable: true, sortable: false, filterable: false, dataType: 'number' },
{ field: 'sold', header: 'Units sold', hidden: false, resizable: true, sortable: false, filterable: false, dataType: 'number' },
{ field: 'total', header: 'Total sold', hidden: false, resizable: true, sortable: false, filterable: false, dataType: 'number' },
{ field: 'rating', header: 'Customer rating', hidden: false, resizable: true, sortable: false, filterable: false, dataType: 'number' }
];- Use the respective properties in your grid
<igx-grid-lite-column [field]="col.field" [header]="col.header" [hidden]="col.hidden"
[dataType]="col.dataType"> </igx-grid-lite-column>- Save and see the console. The following issue appears:
[ERROR] TS2322: Type 'string | number | symbol' is not assignable to type 'Keys<{ [x: string]: {}; }>'.
Type 'symbol' is not assignable to type 'Keys<{ [x: string]: {}; }>'. [plugin angular-compiler]- When we give the columns list this type it works
columns: IgxGridLiteColumnConfiguration<ProductInfo>[]Result
We are not able to use IgxGridLiteColumnConfiguration without specifying a generic type argument
Expected result
We should be able to use IgxGridLiteColumnConfiguration without specifying a generic type argument
Reactions are currently unavailable