@@ -43,6 +43,7 @@ import { DeprecateProperty } from '../core/deprecateDecorators';
43
43
templateUrl : './cell.component.html'
44
44
} )
45
45
export class IgxGridCellComponent implements OnInit , OnChanges , OnDestroy {
46
+ private _vIndex = - 1 ;
46
47
47
48
/**
48
49
* Gets the column of the cell.
@@ -233,7 +234,13 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
233
234
*/
234
235
@HostBinding ( 'attr.data-visibleIndex' )
235
236
@Input ( )
236
- visibleColumnIndex = - 1 ;
237
+ get visibleColumnIndex ( ) {
238
+ return this . column . columnLayoutChild ? this . column . visibleIndex : this . _vIndex ;
239
+ }
240
+
241
+ set visibleColumnIndex ( val ) {
242
+ this . _vIndex = val ;
243
+ }
237
244
238
245
/**
239
246
* Gets the ID of the cell.
@@ -497,7 +504,17 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
497
504
}
498
505
499
506
protected get selectionNode ( ) : ISelectionNode {
500
- return { row : this . rowIndex , column : this . visibleColumnIndex } ;
507
+ return {
508
+ row : this . rowIndex ,
509
+ column : this . column . columnLayoutChild ? this . column . parent . visibleIndex : this . visibleColumnIndex ,
510
+ layout : this . column . columnLayoutChild ? {
511
+ rowStart : this . column . rowStart ,
512
+ colStart : this . column . colStart ,
513
+ rowEnd : this . column . rowEnd ,
514
+ colEnd : this . column . colEnd ,
515
+ columnVisibleIndex : this . visibleColumnIndex
516
+ } : null
517
+ } ;
501
518
}
502
519
503
520
protected isInCompositionMode = false ;
@@ -689,6 +706,9 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
689
706
* @internal
690
707
*/
691
708
pointerup = ( ) => {
709
+ if ( this . grid . hasColumnLayouts ) {
710
+ this . grid . navigation . setStartNavigationCell ( this . colStart , this . rowStart , null ) ;
711
+ }
692
712
if ( this . selectionService . pointerUp ( this . selectionNode , this . grid . onRangeSelection ) ) {
693
713
this . grid . cdr . detectChanges ( ) ;
694
714
}
@@ -743,7 +763,8 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
743
763
this . focused = true ;
744
764
this . row . focused = true ;
745
765
this . _updateCellSelectionStatus ( ) ;
746
- if ( ! this . selectionService . isActiveNode ( this . selectionNode ) ) {
766
+ if ( ! this . selectionService . isActiveNode ( this . selectionNode ) ||
767
+ this . grid . hasColumnLayouts ) {
747
768
this . grid . onSelection . emit ( { cell : this , event } ) ;
748
769
}
749
770
this . selectionService . activeElement = this . selectionNode ;
@@ -773,25 +794,25 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
773
794
774
795
protected handleTab ( shift : boolean ) {
775
796
if ( shift ) {
776
- this . grid . navigation . performShiftTabKey ( this . row . nativeElement , this . rowIndex , this . visibleColumnIndex ) ;
797
+ this . grid . navigation . performShiftTabKey ( this . row . nativeElement , this . selectionNode ) ;
777
798
} else {
778
- this . grid . navigation . performTab ( this . row . nativeElement , this . rowIndex , this . visibleColumnIndex ) ;
799
+ this . grid . navigation . performTab ( this . row . nativeElement , this . selectionNode ) ;
779
800
}
780
801
}
781
802
782
803
protected handleEnd ( ctrl : boolean ) {
783
804
if ( ctrl ) {
784
805
this . grid . navigation . goToLastCell ( ) ;
785
806
} else {
786
- this . grid . navigation . onKeydownEnd ( this . rowIndex ) ;
807
+ this . grid . navigation . onKeydownEnd ( this . rowIndex , false , this . rowStart ) ;
787
808
}
788
809
}
789
810
790
811
protected handleHome ( ctrl : boolean ) {
791
812
if ( ctrl ) {
792
813
this . grid . navigation . goToFirstCell ( ) ;
793
814
} else {
794
- this . grid . navigation . onKeydownHome ( this . rowIndex ) ;
815
+ this . grid . navigation . onKeydownHome ( this . rowIndex , false , this . rowStart ) ;
795
816
}
796
817
}
797
818
@@ -865,34 +886,34 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
865
886
case 'arrowleft' :
866
887
case 'left' :
867
888
if ( ctrl ) {
868
- this . grid . navigation . onKeydownHome ( node . row ) ;
889
+ this . grid . navigation . onKeydownHome ( node . row , false , this . rowStart ) ;
869
890
break ;
870
891
}
871
- this . grid . navigation . onKeydownArrowLeft ( this . nativeElement , node . row , node . column ) ;
892
+ this . grid . navigation . onKeydownArrowLeft ( this . nativeElement , this . selectionNode ) ;
872
893
break ;
873
894
case 'arrowright' :
874
895
case 'right' :
875
896
if ( ctrl ) {
876
- this . grid . navigation . onKeydownEnd ( node . row ) ;
897
+ this . grid . navigation . onKeydownEnd ( node . row , false , this . rowStart ) ;
877
898
break ;
878
899
}
879
- this . grid . navigation . onKeydownArrowRight ( this . nativeElement , node . row , node . column ) ;
900
+ this . grid . navigation . onKeydownArrowRight ( this . nativeElement , this . selectionNode ) ;
880
901
break ;
881
902
case 'arrowup' :
882
903
case 'up' :
883
904
if ( ctrl ) {
884
- this . grid . navigation . navigateTop ( node . column ) ;
905
+ this . grid . navigation . navigateTop ( this . visibleColumnIndex ) ;
885
906
break ;
886
907
}
887
- this . grid . navigation . navigateUp ( this . row . nativeElement , node . row , node . column ) ;
908
+ this . grid . navigation . navigateUp ( this . row . nativeElement , this . selectionNode ) ;
888
909
break ;
889
910
case 'arrowdown' :
890
911
case 'down' :
891
912
if ( ctrl ) {
892
- this . grid . navigation . navigateBottom ( node . column ) ;
913
+ this . grid . navigation . navigateBottom ( this . visibleColumnIndex ) ;
893
914
break ;
894
915
}
895
- this . grid . navigation . navigateDown ( this . row . nativeElement , node . row , node . column ) ;
916
+ this . grid . navigation . navigateDown ( this . row . nativeElement , this . selectionNode ) ;
896
917
break ;
897
918
case 'enter' :
898
919
case 'f2' :
0 commit comments