Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 1.05 KB

events-fired-centrally-by-the-app-or-the-navcontainer-6ec0a7e.md

File metadata and controls

25 lines (14 loc) · 1.05 KB

Events Fired Centrally by the App or the NavContainer

When NavContainer.to(…) or NavContainer.back(…) are called, the NavContainer triggers events and the application can register for this events. The navigate event is fired before the transition animation starts, and the afterNavigate event is fired when the animation has been completed.

The events contain a lot of information about the page that is left and the target page of the navigation, as well as what kind of navigation is happening.

Example:

app.attachNavigate(function(evt) {
   var isBack = !evt.getParameter("isTo"); // there are several types of back animation, but we want the general direction only
   alert("Navigating " + (isBack ? "back " : "") + " to page " + evt.getParameter("toId"));
});

Related Information

API Reference event: afterNavigate

API Reference event: navigate