@@ -40,8 +40,12 @@ sap.ui.define([
4040 this . _oRouterArgs = oEvent . getParameter ( "arguments" ) ;
4141 //make sure we either have a value or empty hand empty object
4242 this . _oRouterArgs [ "?query" ] = this . _oRouterArgs [ "?query" ] || { } ;
43+ var oQueryParameter = this . _oRouterArgs [ "?query" ] ;
44+
4345 // search/filter via URL hash
4446 this . _applySearchFilter ( this . _oRouterArgs [ "?query" ] . search ) ;
47+ // sorting via URL hash
48+ this . _applySorter ( oQueryParameter . sortField , oQueryParameter . sortDescending ) ;
4549 } ,
4650
4751 onSortButtonPressed : function ( ) {
@@ -56,11 +60,15 @@ sap.ui.define([
5660 oRouter . navTo ( "employeeOverview" , this . _oRouterArgs , true /*no history*/ ) ;
5761 } ,
5862
59- _initViewSettingsDialog : function ( ) {
63+ _initViewSettingsDialog : function ( ) {
64+ var oRouter = this . getRouter ( ) ;
6065 this . _oVSD = new ViewSettingsDialog ( "vsd" , {
6166 confirm : function ( oEvent ) {
6267 var oSortItem = oEvent . getParameter ( "sortItem" ) ;
6368 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*/ ) ;
6472 } . bind ( this )
6573 } ) ;
6674
0 commit comments