File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
projects/igniteui-angular/src/lib/grids/pivot-grid Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { IgxPivotGridComponent } from './pivot-grid.component';
44import { HEADER_KEYS } from '../../core/utils' ;
55import { IgxPivotRowDimensionMrlRowComponent } from './pivot-row-dimension-mrl-row.component' ;
66import { IMultiRowLayoutNode } from '../public_api' ;
7+ import { SortingDirection } from '../../data-operations/sorting-strategy' ;
78
89@Injectable ( )
910export class IgxPivotGridNavigationService extends IgxGridNavigationService {
@@ -127,6 +128,22 @@ export class IgxPivotGridNavigationService extends IgxGridNavigationService {
127128 layout : null
128129 }
129130
131+ if ( ctrl ) {
132+ const dimIndex = this . activeNode . column ;
133+ const dim = this . grid . rowDimensions [ dimIndex ] ;
134+ if ( dimIndex === 0 && this . activeNode . row === - 1 ) {
135+ if ( key . includes ( 'down' ) || key . includes ( 'up' ) ) {
136+ let newSortDirection = SortingDirection . None ;
137+ if ( key . includes ( 'down' ) ) {
138+ newSortDirection = ( dim . sortDirection === SortingDirection . Desc ) ? SortingDirection . None : SortingDirection . Desc ;
139+ } else if ( key . includes ( 'up' ) ) {
140+ newSortDirection = ( dim . sortDirection === SortingDirection . Asc ) ? SortingDirection . None : SortingDirection . Asc ;
141+ }
142+ this . grid . sortDimension ( dim , newSortDirection ) ;
143+ return ;
144+ }
145+ }
146+ }
130147 if ( ( key . includes ( 'left' ) || key === 'home' ) && this . activeNode . column > 0 ) {
131148 newActiveNode . column = ctrl || key === 'home' ? 0 : this . activeNode . column - 1 ;
132149 }
Original file line number Diff line number Diff line change 2020 (pointerdown) ="pointerdown($event) "
2121 [igxColumnMovingDrop] ="column "
2222 [column] ="column "
23+ (keydown) ="grid.navigation.headerNavigation($event) "
2324 >
2425 </ igx-pivot-row-dimension-header >
2526 < span *ngIf ="!column.columnGroup && column.resizable " class ="igx-grid-th__resize-handle "
You can’t perform that action at this time.
0 commit comments