Skip to content

Commit ea5a831

Browse files
committed
chore(grids): fix typo and check if rowContext is nullish
1 parent 03e3406 commit ea5a831

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/app/grid/grid-action-strip/grid-action-strip-sample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class GridActionStripSampleComponent {
1818
}
1919

2020
public isDirty(rowContext: RowType) {
21-
const isRowEdited = this.grid.transactions.getAggregatedChanges(true).find(x => x.id === rowContext.key);
21+
const isRowEdited = this.grid.transactions.getAggregatedChanges(true).find(x => x.id === rowContext?.key);
2222
return rowContext && (rowContext.deleted || isRowEdited);
2323
}
2424

src/app/hierarchical-grid/hierarchical-grid-action-strip/hierarchical-grid-action-strip-sample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class HGridActionStripSampleComponent implements AfterViewInit{
2929
public formatter = (a) => a;
3030

3131
public isDirty(rowContext: RowType) {
32-
const isRowEdited = this.grid.transactions.getAggregatedChanges(true).find(x => x.id === rowContext.key);
32+
const isRowEdited = this.grid.transactions.getAggregatedChanges(true).find(x => x.id === rowContext?.key);
3333
return rowContext && (rowContext.deleted || isRowEdited);
3434
}
3535

src/app/tree-grid/tree-grid-action-strip/tree-grid-action-strip-sample.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
(click)='redo(actionstrip.context)'>
2929
<igx-icon>redo</igx-icon>
3030
</button>
31-
<button title='Saveeeeeeee' igxButton="icon" igxRipple *ngIf='isDirty(actionstrip.context)'
31+
<button title='Save' igxButton="icon" igxRipple *ngIf='isDirty(actionstrip.context)'
3232
(click)='commit(actionstrip.context)'>
3333
<igx-icon>save</igx-icon>
3434
</button>

src/app/tree-grid/tree-grid-action-strip/tree-grid-action-strip-sample.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, ViewChild } from '@angular/core';
1+
import { Component, ViewChild } from '@angular/core';
22
import { IgxTreeGridComponent, RowType, Transaction } from 'igniteui-angular';
33
import { generateEmployeeDetailedFlatData } from '../data/employees-flat-detailed';
44

@@ -18,7 +18,7 @@ export class TreeGridActionStripSampleComponent {
1818
}
1919

2020
public isDirty(rowContext: RowType) {
21-
const isRowEdited = this.grid.transactions.getAggregatedChanges(true).find(x => x.id === rowContext.key);
21+
const isRowEdited = this.grid.transactions.getAggregatedChanges(true).find(x => x.id === rowContext?.key);
2222
return rowContext && (rowContext.deleted || isRowEdited);
2323
}
2424

0 commit comments

Comments
 (0)