@@ -73,14 +73,12 @@ export class IgxEditRow {
7373 return args ;
7474 }
7575
76- public getClassName ( ) {
77- return this . constructor . name ;
76+ public get isAddRow ( ) : boolean {
77+ return false ;
7878 }
7979}
8080
8181export class IgxAddRow extends IgxEditRow {
82- public isAddRow = true ;
83-
8482 constructor ( id : any ,
8583 index : number ,
8684 data : any ,
@@ -102,6 +100,10 @@ export class IgxAddRow extends IgxEditRow {
102100 args . isAddRow = true ;
103101 return args ;
104102 }
103+
104+ public override get isAddRow ( ) : boolean {
105+ return true ;
106+ }
105107}
106108
107109export interface IgxAddRowParent {
@@ -376,7 +378,7 @@ export class IgxRowCrudState extends IgxCellCrudState {
376378
377379 /** Enters row edit mode */
378380 public beginRowEdit ( event ?: Event ) {
379- if ( ! this . row || ! ( this . row . getClassName ( ) === IgxEditRow . name ) ) {
381+ if ( ! this . row || this . row . isAddRow ) {
380382 if ( ! this . row ) {
381383 this . createRow ( this . cell ) ;
382384 }
@@ -437,14 +439,14 @@ export class IgxRowCrudState extends IgxCellCrudState {
437439 let nonCancelableArgs ;
438440 if ( ! commit ) {
439441 this . grid . transactions . endPending ( false ) ;
440- const isAddRow = this . row && this . row . getClassName ( ) === IgxAddRow . name ;
442+ const isAddRow = this . row && this . row . isAddRow ;
441443 const id = this . row ? this . row . id : this . cell . id . rowID ;
442444 if ( isAddRow ) {
443445 this . grid . validation . clear ( id ) ;
444446 } else {
445447 this . grid . validation . update ( id , rowEditArgs . oldValue ) ;
446448 }
447- } else if ( this . row . getClassName ( ) === IgxEditRow . name ) {
449+ } else if ( ! this . row . isAddRow ) {
448450 rowEditArgs = this . grid . gridAPI . update_row ( this . row , this . row . newData , event ) ;
449451 nonCancelableArgs = this . rowEditDone ( rowEditArgs . oldValue , event ) ;
450452 } else {
@@ -560,7 +562,7 @@ export class IgxRowAddCrudState extends IgxRowCrudState {
560562 * @hidden @internal
561563 */
562564 public override endRowTransaction ( commit : boolean , event ?: Event ) : IGridEditEventArgs | IRowDataCancelableEventArgs {
563- const isAddRow = this . row && this . row . getClassName ( ) === IgxAddRow . name ;
565+ const isAddRow = this . row && this . row . isAddRow ;
564566 if ( isAddRow ) {
565567 this . grid . rowAdded . pipe ( first ( ) ) . subscribe ( ( addRowArgs : IRowDataEventArgs ) => {
566568 const rowData = addRowArgs . data ;
0 commit comments