Skip to content

Commit 0efe570

Browse files
authored
Merge pull request #7100 from IgniteUI/mkirova/fix-7091
chore(*): Fix issue with cells that no longer exits in DOM returned b…
2 parents e641870 + 71d92c5 commit 0efe570

File tree

5 files changed

+20
-40
lines changed

5 files changed

+20
-40
lines changed

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,6 @@ export class IgxGridRowComponent extends IgxRowDirective<IgxGridComponent> {
2525
super(gridAPI, crudService, selectionService, element, cdr);
2626
}
2727

28-
@ViewChildren('cell')
29-
private _cells: QueryList<any>;
30-
31-
public get cells() {
32-
const res = new QueryList<any>();
33-
if (!this._cells) {
34-
return res;
35-
}
36-
const cList = this._cells.filter((item) => item.nativeElement.parentElement !== null)
37-
.sort((item1, item2) => item1.column.visibleIndex - item2.column.visibleIndex);
38-
res.reset(cList);
39-
return res;
40-
}
41-
42-
public set cells(cells) {
43-
44-
}
45-
4628
@HostBinding('class.igx-grid__tr--mrl')
4729
get hasColumnLayouts(): boolean {
4830
return this.grid.hasColumnLayouts;

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.navigation.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ describe('IgxHierarchicalGrid Basic Navigation #hGrid', () => {
151151
}));
152152

153153
it('should allow navigating to start in child grid when child grid target row moves outside the parent view port.', (async () => {
154-
pending('related to the bug #7091');
155154
hierarchicalGrid.verticalScrollContainer.scrollTo(2);
156155
await wait(DEBOUNCE_TIME);
157156
fixture.detectChanges();

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,8 @@ import { IgxHierarchicalGridCellComponent } from './hierarchical-cell.component'
2121
providers: [{ provide: IgxRowDirective, useExisting: forwardRef(() => IgxHierarchicalRowComponent) }]
2222
})
2323
export class IgxHierarchicalRowComponent extends IgxRowDirective<IgxHierarchicalGridComponent> {
24-
/**
25-
* The rendered cells in the row component.
26-
*
27-
* ```typescript
28-
* // get the cells of the third selected row
29-
* let selectedRowCells = this.grid.selectedRows[2].cells;
30-
* ```
31-
*/
3224
@ViewChildren(forwardRef(() => IgxHierarchicalGridCellComponent), { read: IgxHierarchicalGridCellComponent })
33-
public cells: QueryList<IgxHierarchicalGridCellComponent>;
25+
protected _cells: QueryList<IgxHierarchicalGridCellComponent>;
3426

3527
@ViewChild('expander', { read: ElementRef })
3628
public expander: ElementRef<HTMLElement>;

projects/igniteui-angular/src/lib/grids/row.directive.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,31 @@ export class IgxRowDirective<T extends IgxGridBaseDirective & GridType> implemen
100100
@ViewChild(forwardRef(() => IgxCheckboxComponent), { read: IgxCheckboxComponent })
101101
public checkboxElement: IgxCheckboxComponent;
102102

103+
@ViewChildren('cell')
104+
protected _cells: QueryList<any>;
105+
103106
/**
104-
* The rendered cells in the row component.
107+
* Gets the rendered cells in the row component.
105108
*
106109
* ```typescript
107110
* // get the cells of the third selected row
108111
* let selectedRowCells = this.grid.selectedRows[2].cells;
109112
* ```
110113
*/
111-
@ViewChildren(forwardRef(() => IgxGridCellComponent))
112-
public cells: QueryList<IgxGridCellComponent>;
114+
public get cells() {
115+
const res = new QueryList<any>();
116+
if (!this._cells) {
117+
return res;
118+
}
119+
const cList = this._cells.filter((item) => item.nativeElement.parentElement !== null)
120+
.sort((item1, item2) => item1.column.visibleIndex - item2.column.visibleIndex);
121+
res.reset(cList);
122+
return res;
123+
}
124+
125+
public set cells(cells) {
126+
127+
}
113128

114129
/**
115130
* @hidden

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,8 @@ import { IgxTreeGridAPIService } from './tree-grid-api.service';
1313
export class IgxTreeGridRowComponent extends IgxRowDirective<IgxTreeGridComponent> implements DoCheck {
1414
private _treeRow: ITreeGridRecord;
1515

16-
/**
17-
* The rendered cells in the row component.
18-
*
19-
* ```typescript
20-
* const row = this.grid.getRowByKey(1);
21-
* const cells = row.cells;
22-
* ```
23-
*/
2416
@ViewChildren('treeCell')
25-
public cells: QueryList<any>;
17+
protected _cells: QueryList<any>;
2618

2719
/**
2820
* The `ITreeGridRecord` passed to the row component.

0 commit comments

Comments
 (0)