Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { FilterMode } from './enums';

export interface GridType {
id: string;
nativeElement: HTMLElement;
rowEditable: boolean;
rootSummariesEnabled: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ export class IgxGridNavigationService {

protected getNextRowByIndex(nextIndex) {
return this.grid.tbody.nativeElement.querySelector(
`[data-rowindex="${nextIndex}"]`);
`[data-rowindex="${nextIndex}"][data-gridid="${this.grid.id}"]`);
}

private getAllRows() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class IgxGridGroupByRowComponent {
* ```
*/
@Input()
@HostBinding('attr.data-gridID')
public gridID: string;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,35 @@ describe('IgxHierarchicalGrid Basic Navigation #hGrid', () => {
}));

// simple tests
it('should allow navigating down from parent row into child grid.', () => {
const fCell = hierarchicalGrid.dataRowList.toArray()[0].cells.toArray()[0].nativeElement;
it('should allow navigating down from parent row into child grid.', (async() => {
hierarchicalGrid.expandChildren = false;
hierarchicalGrid.height = '600px';
hierarchicalGrid.width = '800px';
fixture.componentInstance.rowIsland.height = '350px';
fixture.detectChanges();
await wait(100);

const row1 = hierarchicalGrid.dataRowList.toArray()[0] as IgxHierarchicalRowComponent;
UIInteractions.clickElement(row1.expander);
fixture.detectChanges();
await wait(100);

const fCell = hierarchicalGrid.dataRowList.toArray()[1].cells.toArray()[0].nativeElement;
fCell.focus();
fixture.detectChanges();

const keyboardEvent = new KeyboardEvent('keydown', {
code: 'ArrowDown',
key: 'ArrowDown'
});
fCell.dispatchEvent(keyboardEvent);
await wait(100);
fixture.detectChanges();

const childGrid = hierarchicalGrid.hgridAPI.getChildGrids(false)[0];
const childFirstCell = childGrid.dataRowList.toArray()[0].cells.toArray()[0];

expect(childFirstCell.selected).toBe(true);
expect(childFirstCell.focused).toBe(true);
});
const sCell = hierarchicalGrid.dataRowList.toArray()[2].cells.toArray()[0];
expect(sCell.selected).toBe(true);
expect(sCell.focused).toBe(true);
}));

it('should allow navigating up from child row into parent grid.', () => {
const childGrid = hierarchicalGrid.hgridAPI.getChildGrids(false)[0];
Expand Down
1 change: 1 addition & 0 deletions projects/igniteui-angular/src/lib/grids/row.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export abstract class IgxRowComponent<T extends IgxGridBaseComponent & IGridData
* @hidden
*/
@Input()
@HostBinding('attr.data-gridID')
public gridID: string;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class IgxSummaryRowComponent implements DoCheck {
public summaries: Map<string, IgxSummaryResult[]>;

@Input()
@HostBinding('attr.data-gridID')
public gridID;

@Input()
Expand Down