@@ -38,37 +38,47 @@ sap.ui.define([
38
38
_onRouteMatched : function ( oEvent ) {
39
39
// save the current query state
40
40
this . _oRouterArgs = oEvent . getParameter ( "arguments" ) ;
41
- //make sure we either have a value or empty hand empty object
42
41
this . _oRouterArgs [ "?query" ] = this . _oRouterArgs [ "?query" ] || { } ;
43
42
var oQueryParameter = this . _oRouterArgs [ "?query" ] ;
44
43
45
44
// search/filter via URL hash
46
45
this . _applySearchFilter ( this . _oRouterArgs [ "?query" ] . search ) ;
47
46
// sorting via URL hash
48
47
this . _applySorter ( oQueryParameter . sortField , oQueryParameter . sortDescending ) ;
48
+ // show dialog via URL hash
49
+ if ( oQueryParameter . showDialog ) {
50
+ this . _oVSD . open ( ) ;
51
+ }
49
52
} ,
50
53
51
54
onSortButtonPressed : function ( ) {
52
- this . _oVSD . open ( ) ;
55
+ // this._oVSD.open();
56
+ var oRouter = this . getRouter ( ) ;
57
+ this . _oRouterArgs [ "?query" ] . showDialog = 1 ;
58
+ oRouter . navTo ( "employeeOverview" , this . _oRouterArgs ) ;
53
59
} ,
54
60
55
61
onSearchEmployeesTable : function ( oEvent ) {
56
62
//this._applySearchFilter(oEvent.getSource().getValue()); -> now being handled when route is matched
57
63
var oRouter = this . getRouter ( ) ;
58
64
// update the hash with the current search term -> ?search=<searchValue>
59
65
this . _oRouterArgs [ "?query" ] . search = oEvent . getSource ( ) . getValue ( ) ;
60
- oRouter . navTo ( "employeeOverview" , this . _oRouterArgs , true /*no history*/ ) ;
66
+ oRouter . navTo ( "employeeOverview" , this . _oRouterArgs , true /*no history*/ ) ;
61
67
} ,
62
68
63
- _initViewSettingsDialog : function ( ) {
69
+ _initViewSettingsDialog : function ( ) {
64
70
var oRouter = this . getRouter ( ) ;
65
71
this . _oVSD = new ViewSettingsDialog ( "vsd" , {
66
72
confirm : function ( oEvent ) {
67
73
var oSortItem = oEvent . getParameter ( "sortItem" ) ;
68
74
this . _applySorter ( oSortItem . getKey ( ) , oEvent . getParameter ( "sortDescending" ) ) ;
69
75
this . _oRouterArgs [ "?query" ] . sortField = oSortItem . getKey ( ) ;
70
76
this . _oRouterArgs [ "?query" ] . sortDescending = oEvent . getParameter ( "sortDescending" ) ;
71
- oRouter . navTo ( "employeeOverview" , this . _oRouterArgs , true /*without history*/ ) ;
77
+ oRouter . navTo ( "employeeOverview" , this . _oRouterArgs , true /*without history*/ ) ;
78
+ } . bind ( this ) ,
79
+ cancel : function ( ) {
80
+ delete this . _oRouterArgs [ "?query" ] . showDialog ;
81
+ oRouter . navTo ( "employeeOverview" , this . _oRouterArgs , true /*without history*/ ) ;
72
82
} . bind ( this )
73
83
} ) ;
74
84
0 commit comments