File tree 2 files changed +29
-0
lines changed
nunaliit2-js/src/main/js/nunaliit2
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 21
21
margin : 9px 5px 9px 0px ;
22
22
padding : 2px 5px ;
23
23
}
24
+
25
+ .n2TableCanvas .nunaliit-sort-asc-1 a ::after {
26
+ content : " \25bc" ;
27
+ }
28
+
29
+ .n2TableCanvas .nunaliit-sort-desc-1 a ::after {
30
+ content : " \25b2" ;
31
+ }
32
+
Original file line number Diff line number Diff line change @@ -896,6 +896,26 @@ var TableCanvas = $n2.Class({
896
896
, direction : 1
897
897
} ) ;
898
898
} ;
899
+
900
+ const headerElements = $ ( 'th' ) ;
901
+ for ( let i = 0 ; i < headerElements . length ; i ++ ) {
902
+ $ ( headerElements [ i ] ) . removeClass ( ) ;
903
+ }
904
+
905
+ //remove sort info
906
+ for ( let i = 0 ; i < this . sortOrder . length ; i ++ ) {
907
+ const s = this . sortOrder [ i ] ;
908
+ const order = i + 1
909
+ //add sort order info to th
910
+ const thElement = $ ( ( $ ( `a[data-sort-name=${ s . name } ]` ) . parent ( ) ) [ 0 ] )
911
+ if ( s . direction > 0 ) {
912
+ thElement . addClass ( 'nunaliit-sort-asc' )
913
+ thElement . addClass ( `nunaliit-sort-asc-${ order } ` )
914
+ } else {
915
+ thElement . addClass ( 'nunaliit-sort-desc' )
916
+ thElement . addClass ( `nunaliit-sort-desc-${ order } ` )
917
+ }
918
+ }
899
919
900
920
this . _sortRows ( this . sortedRows ) ;
901
921
You can’t perform that action at this time.
0 commit comments