@@ -40,8 +40,12 @@ sap.ui.define([
40
40
this . _oRouterArgs = oEvent . getParameter ( "arguments" ) ;
41
41
//make sure we either have a value or empty hand empty object
42
42
this . _oRouterArgs [ "?query" ] = this . _oRouterArgs [ "?query" ] || { } ;
43
+ var oQueryParameter = this . _oRouterArgs [ "?query" ] ;
44
+
43
45
// search/filter via URL hash
44
46
this . _applySearchFilter ( this . _oRouterArgs [ "?query" ] . search ) ;
47
+ // sorting via URL hash
48
+ this . _applySorter ( oQueryParameter . sortField , oQueryParameter . sortDescending ) ;
45
49
} ,
46
50
47
51
onSortButtonPressed : function ( ) {
@@ -56,11 +60,15 @@ sap.ui.define([
56
60
oRouter . navTo ( "employeeOverview" , this . _oRouterArgs , true /*no history*/ ) ;
57
61
} ,
58
62
59
- _initViewSettingsDialog : function ( ) {
63
+ _initViewSettingsDialog : function ( ) {
64
+ var oRouter = this . getRouter ( ) ;
60
65
this . _oVSD = new ViewSettingsDialog ( "vsd" , {
61
66
confirm : function ( oEvent ) {
62
67
var oSortItem = oEvent . getParameter ( "sortItem" ) ;
63
68
this . _applySorter ( oSortItem . getKey ( ) , oEvent . getParameter ( "sortDescending" ) ) ;
69
+ this . _oRouterArgs [ "?query" ] . sortField = oSortItem . getKey ( ) ;
70
+ this . _oRouterArgs [ "?query" ] . sortDescending = oEvent . getParameter ( "sortDescending" ) ;
71
+ oRouter . navTo ( "employeeOverview" , this . _oRouterArgs , true /*without history*/ ) ;
64
72
} . bind ( this )
65
73
} ) ;
66
74
0 commit comments