Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(*): Fix issue with cells that no longer exits in DOM returned b… #7100

Merged
merged 3 commits into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions projects/igniteui-angular/src/lib/grids/grid/grid-row.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@ export class IgxGridRowComponent extends IgxRowDirective<IgxGridComponent> {
super(gridAPI, crudService, selectionService, element, cdr);
}

@ViewChildren('cell')
private _cells: QueryList<any>;

public get cells() {
const res = new QueryList<any>();
if (!this._cells) {
return res;
}
const cList = this._cells.filter((item) => item.nativeElement.parentElement !== null)
.sort((item1, item2) => item1.column.visibleIndex - item2.column.visibleIndex);
res.reset(cList);
return res;
}

public set cells(cells) {

}

@HostBinding('class.igx-grid__tr--mrl')
get hasColumnLayouts(): boolean {
return this.grid.hasColumnLayouts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ describe('IgxHierarchicalGrid Basic Navigation #hGrid', () => {
}));

it('should allow navigating to start in child grid when child grid target row moves outside the parent view port.', (async () => {
pending('related to the bug #7091');
hierarchicalGrid.verticalScrollContainer.scrollTo(2);
await wait(DEBOUNCE_TIME);
fixture.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,8 @@ import { IgxHierarchicalGridCellComponent } from './hierarchical-cell.component'
providers: [{ provide: IgxRowDirective, useExisting: forwardRef(() => IgxHierarchicalRowComponent) }]
})
export class IgxHierarchicalRowComponent extends IgxRowDirective<IgxHierarchicalGridComponent> {
/**
* The rendered cells in the row component.
*
* ```typescript
* // get the cells of the third selected row
* let selectedRowCells = this.grid.selectedRows[2].cells;
* ```
*/
@ViewChildren(forwardRef(() => IgxHierarchicalGridCellComponent), { read: IgxHierarchicalGridCellComponent })
public cells: QueryList<IgxHierarchicalGridCellComponent>;
protected _cells: QueryList<IgxHierarchicalGridCellComponent>;

@ViewChild('expander', { read: ElementRef })
public expander: ElementRef<HTMLElement>;
Expand Down
21 changes: 18 additions & 3 deletions projects/igniteui-angular/src/lib/grids/row.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,31 @@ export class IgxRowDirective<T extends IgxGridBaseDirective & GridType> implemen
@ViewChild(forwardRef(() => IgxCheckboxComponent), { read: IgxCheckboxComponent })
public checkboxElement: IgxCheckboxComponent;

@ViewChildren('cell')
protected _cells: QueryList<any>;

/**
* The rendered cells in the row component.
* Gets the rendered cells in the row component.
*
* ```typescript
* // get the cells of the third selected row
* let selectedRowCells = this.grid.selectedRows[2].cells;
* ```
*/
@ViewChildren(forwardRef(() => IgxGridCellComponent))
public cells: QueryList<IgxGridCellComponent>;
public get cells() {
const res = new QueryList<any>();
if (!this._cells) {
return res;
}
const cList = this._cells.filter((item) => item.nativeElement.parentElement !== null)
.sort((item1, item2) => item1.column.visibleIndex - item2.column.visibleIndex);
res.reset(cList);
return res;
}

public set cells(cells) {

}

/**
* @hidden
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,8 @@ import { IgxTreeGridAPIService } from './tree-grid-api.service';
export class IgxTreeGridRowComponent extends IgxRowDirective<IgxTreeGridComponent> implements DoCheck {
private _treeRow: ITreeGridRecord;

/**
* The rendered cells in the row component.
*
* ```typescript
* const row = this.grid.getRowByKey(1);
* const cells = row.cells;
* ```
*/
@ViewChildren('treeCell')
public cells: QueryList<any>;
protected _cells: QueryList<any>;

/**
* The `ITreeGridRecord` passed to the row component.
Expand Down