Skip to content

Commit 6d66d25

Browse files
authored
Merge pull request #8400 from IgniteUI/mdragnev/fix-add-row-id
Generate correct id based on data type of primary column
2 parents a868784 + c379774 commit 6d66d25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3149,7 +3149,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
31493149
*/
31503150
public generateRowID(): string | number {
31513151
const primaryColumn = this.columnList.find(col => col.field === this.primaryKey);
3152-
const idType = primaryColumn ? primaryColumn.dataType : this.data.length ? typeof (this.data[0][this.primaryKey]) : 'string';
3152+
const idType = this.data.length ? typeof (this.data[0][this.primaryKey]) : primaryColumn ? primaryColumn.dataType : 'string';
31533153
return idType === 'string' ? uuidv4() : FAKE_ROW_ID--;
31543154
}
31553155

0 commit comments

Comments
 (0)