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';
4
4
import { HEADER_KEYS } from '../../core/utils' ;
5
5
import { IgxPivotRowDimensionMrlRowComponent } from './pivot-row-dimension-mrl-row.component' ;
6
6
import { IMultiRowLayoutNode } from '../public_api' ;
7
+ import { SortingDirection } from '../../data-operations/sorting-strategy' ;
7
8
8
9
@Injectable ( )
9
10
export class IgxPivotGridNavigationService extends IgxGridNavigationService {
@@ -127,6 +128,22 @@ export class IgxPivotGridNavigationService extends IgxGridNavigationService {
127
128
layout : null
128
129
}
129
130
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
+ }
130
147
if ( ( key . includes ( 'left' ) || key === 'home' ) && this . activeNode . column > 0 ) {
131
148
newActiveNode . column = ctrl || key === 'home' ? 0 : this . activeNode . column - 1 ;
132
149
}
Original file line number Diff line number Diff line change 20
20
(pointerdown) ="pointerdown($event) "
21
21
[igxColumnMovingDrop] ="column "
22
22
[column] ="column "
23
+ (keydown) ="grid.navigation.headerNavigation($event) "
23
24
>
24
25
</ igx-pivot-row-dimension-header >
25
26
< span *ngIf ="!column.columnGroup && column.resizable " class ="igx-grid-th__resize-handle "
You can’t perform that action at this time.
0 commit comments