javascript - SAPUI5 event handler function for view leave -
i declared controller view in sapui5 application. want perform tasks when view leaved user.
there possibility add callback function attachroutepatternmatchedto perform tasks when view navigated user need equivalent function handle leave of view. use splitcontainer parent container
oninit: function () { this._orouter = sap.ui.core.uicomponent.getrouterfor(this); this._orouter.attachroutepatternmatched(this._routepatternmatched, this); }, _routepatternmatched: function (oevent) { var = this; var sroutetargetname = oevent.getparameter("name"); if (sroutetargetname === "myview") { // perform tasks if view opened user } },
you can try if works:
navaway: function(viewname, callback) { this._orouter.navto(viewname); if(callback && typeof(callback) === "function") { callback(); } } e.g. this.navaway("myview", function() { //dostuff });
Comments
Post a Comment