Skip to content

Commit ccff87d

Browse files
ChronosSFzdrawkudkamburovrkaraivanov
authored
feat(rowtype): add implementation for addRowUI #10771 (#10790)
Co-authored-by: Zdravko Kolev <[email protected]> Co-authored-by: Deyan Kamburov <[email protected]> Co-authored-by: Radoslav Karaivanov <[email protected]>
1 parent 57dbaaf commit ccff87d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

projects/igniteui-angular/src/lib/grids/common/grid.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export interface RowType {
9696
parent?: RowType;
9797
hasChildren?: boolean;
9898
treeRow? : ITreeGridRecord;
99-
addRowUI?: any;
99+
addRowUI?: boolean;
100100
focused?: boolean;
101101
grid: GridType;
102102
onRowSelectorClick?: (event: MouseEvent) => void;

projects/igniteui-angular/src/lib/grids/grid-public-row.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IGroupByRecord } from '../data-operations/groupby-record.interface';
2-
import { IgxEditRow } from './common/crud.service';
2+
import { IgxAddRow, IgxEditRow } from './common/crud.service';
33
import { GridInstanceType, GridSummaryCalculationMode, GridSummaryPosition } from './common/enums';
44
import { IgxGridCell } from './grid-public-cell';
55
import { IgxSummaryResult } from './summaries/grid-summary';
@@ -38,6 +38,19 @@ abstract class BaseRow implements RowType {
3838
return primaryKey ? data[primaryKey] : data;
3939
}
4040

41+
/**
42+
* Gets if this represents add row UI
43+
*
44+
* ```typescript
45+
* let isAddRow = row.addRowUI;
46+
* ```
47+
*/
48+
public get addRowUI(): boolean {
49+
return !!this.grid.crudService.row &&
50+
this.grid.crudService.row.getClassName() === IgxAddRow.name &&
51+
this.grid.crudService.row.id === this.key;
52+
}
53+
4154
/**
4255
* The data record that populates the row.
4356
*

0 commit comments

Comments
 (0)