Skip to content

Commit 8bda7da

Browse files
committed
feat(pivot): column dimensions keyboard nav
1 parent 89e9462 commit 8bda7da

File tree

3 files changed

+23
-27
lines changed

3 files changed

+23
-27
lines changed

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid-navigation.service.ts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,30 @@ export class IgxPivotGridNavigationService extends IgxGridNavigationService {
2323
}
2424
event.preventDefault();
2525

26-
const newActiveNode = {
27-
row: this.activeNode.row, column: this.activeNode.column, level: null,
28-
mchCache: null,
29-
layout: null,
30-
isRowDimensionHeader: this.activeNode.isRowDimensionHeader
31-
}
26+
if (this.activeNode.isRowDimensionHeader) {
27+
const newActiveNode = {
28+
row: this.activeNode.row, column: this.activeNode.column, level: null,
29+
mchCache: null,
30+
layout: null,
31+
isRowDimensionHeader: this.activeNode.isRowDimensionHeader
32+
}
3233

33-
if ((key.includes('left') || key === 'home') && this.activeNode.column > 0) {
34-
newActiveNode.column = ctrl || key === 'home' ? 0 : this.activeNode.column - 1;
35-
}
36-
if ((key.includes('right') || key === 'end') && this.activeNode.column < this.lastRowDimensionsIndex) {
37-
newActiveNode.column = ctrl || key === 'end' ? this.lastRowDimensionsIndex : this.activeNode.column + 1;
38-
}
39-
if ((key.includes('up')) && this.activeNode.row > 0) {
40-
newActiveNode.row = ctrl ? 0 : this.activeNode.row - 1;
41-
}
42-
if ((key.includes('down')) && this.activeNode.row < this.findLastDataRowIndex()) {
43-
newActiveNode.row = ctrl ? this.findLastDataRowIndex() : this.activeNode.row + 1;
34+
if ((key.includes('left') || key === 'home') && this.activeNode.column > 0) {
35+
newActiveNode.column = ctrl || key === 'home' ? 0 : this.activeNode.column - 1;
36+
}
37+
if ((key.includes('right') || key === 'end') && this.activeNode.column < this.lastRowDimensionsIndex) {
38+
newActiveNode.column = ctrl || key === 'end' ? this.lastRowDimensionsIndex : this.activeNode.column + 1;
39+
}
40+
if ((key.includes('up')) && this.activeNode.row > 0) {
41+
newActiveNode.row = ctrl ? 0 : this.activeNode.row - 1;
42+
}
43+
if ((key.includes('down')) && this.activeNode.row < this.findLastDataRowIndex()) {
44+
newActiveNode.row = ctrl ? this.findLastDataRowIndex() : this.activeNode.row + 1;
45+
}
46+
this.setActiveNode(newActiveNode);
47+
this.grid.navigateTo(newActiveNode.row);
48+
} else {
49+
super.headerNavigation(event);
4450
}
45-
this.setActiveNode(newActiveNode);
46-
this.grid.navigateTo(newActiveNode.row);
4751
}
4852
}

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,13 +680,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
680680
return;
681681
}
682682

683-
/**
684-
* @hidden @internal
685-
*/
686-
public getColumnByVisibleIndex(_index: number): IgxColumnComponent {
687-
return;
688-
}
689-
690683
/**
691684
* @hidden @internal
692685
*/

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export class IgxPivotRowComponent extends IgxRowDirective implements OnChanges {
106106

107107
public isCellActive(visibleColumnIndex) {
108108
const node = this.grid.navigation.activeNode;
109-
console.log(node && Object.keys(node).length === 0 && !node.isRowDimensionHeader && super.isCellActive(visibleColumnIndex));
110109
return node && Object.keys(node).length !== 0 ?
111110
!node.isRowDimensionHeader &&
112111
super.isCellActive(visibleColumnIndex) :

0 commit comments

Comments
 (0)