@@ -699,7 +699,7 @@ describe('Grid factory', function () {
699
699
var row = grid . rows [ 0 ] ;
700
700
expect ( grid . getCellValue ( row , simpleCol ) ) . toBe ( 'simplePropValue' ) ;
701
701
expect ( grid . getCellDisplayValue ( row , simpleCol ) ) . toBe ( 'simplePropValue' ) ;
702
-
702
+
703
703
var row2 = grid . rows [ 1 ] ;
704
704
expect ( grid . getCellValue ( row2 , simpleCol ) ) . toBe ( 'simplePropValue.2' ) ;
705
705
expect ( grid . getCellDisplayValue ( row2 , simpleCol ) ) . toBe ( 'simplePropValue.2' ) ;
@@ -763,6 +763,49 @@ describe('Grid factory', function () {
763
763
expect ( grid . getCellDisplayValue ( row , grid . columns [ 1 ] ) ) . toEqual ( "WEDNESDAY" ) ;
764
764
} ) ;
765
765
766
+ it ( 'should get cell display value with special chars column name and flatEntityAccess' , function ( ) {
767
+ var colDefs = [
768
+ { name : 'Column 1' , field : 'column.1' } ,
769
+ { name : 'Column 2' , field : 'column \'2\'' , cellFilter : 'number:2' } ,
770
+ { name : 'Column 3' , field : 'column 3' } ,
771
+ { name : 'Column 4' , field : '\\\\////&é"(-è_çà)=+{}:/\\_!<>*|\',?;.§$ꣵ%' }
772
+ ] ;
773
+ var grid = new Grid ( { id : 1 , columnDefs :colDefs , flatEntityAccess :true } ) ;
774
+ var data = [
775
+ {
776
+ 'column.1' : 'test' ,
777
+ 'column \'2\'' : 2 ,
778
+ 'column 3' : '3' ,
779
+ '\\\\////&é"(-è_çà)=+{}:/\\_!<>*|\',?;.§$ꣵ%' : '&é"(-è_çà)=+{}'
780
+ } ,
781
+ {
782
+ 'column.1' : 'test1' ,
783
+ 'column \'2\'' : 3 ,
784
+ 'column 3' : '4' ,
785
+ '\\\\////&é"(-è_çà)=+{}:/\\_!<>*|\',?;.§$ꣵ%' : ''
786
+ }
787
+ ] ;
788
+ var rows = [
789
+ new GridRow ( data [ 0 ] , 1 , grid ) ,
790
+ new GridRow ( data [ 1 ] , 2 , grid )
791
+ ] ;
792
+
793
+ grid . buildColumns ( ) ;
794
+ grid . modifyRows ( data ) ;
795
+
796
+ expect ( grid . getCellDisplayValue ( rows [ 0 ] , grid . getColumn ( 'Column 1' ) ) ) . toBe ( 'test' ) ;
797
+ expect ( grid . getCellDisplayValue ( rows [ 1 ] , grid . getColumn ( 'Column 1' ) ) ) . toBe ( 'test1' ) ;
798
+
799
+ expect ( grid . getCellDisplayValue ( rows [ 0 ] , grid . getColumn ( 'Column 2' ) ) ) . toBe ( '2.00' ) ;
800
+ expect ( grid . getCellDisplayValue ( rows [ 1 ] , grid . getColumn ( 'Column 2' ) ) ) . toBe ( '3.00' ) ;
801
+
802
+ expect ( grid . getCellDisplayValue ( rows [ 0 ] , grid . getColumn ( 'Column 3' ) ) ) . toBe ( '3' ) ;
803
+ expect ( grid . getCellDisplayValue ( rows [ 1 ] , grid . getColumn ( 'Column 3' ) ) ) . toBe ( '4' ) ;
804
+
805
+ expect ( grid . getCellDisplayValue ( rows [ 0 ] , grid . getColumn ( 'Column 4' ) ) ) . toBe ( '&é"(-è_çà)=+{}' ) ;
806
+ expect ( grid . getCellDisplayValue ( rows [ 1 ] , grid . getColumn ( 'Column 4' ) ) ) . toBe ( '' ) ;
807
+ } ) ;
808
+
766
809
it ( 'not overwrite column types specified in options' , function ( ) {
767
810
768
811
var grid1 = new Grid ( { id : 3 } ) ;
0 commit comments