Navigating between the two windows
While our new portfolio management window is created, there is still no way to test it, as all our application is doing right now is showing the first window. What we need to do, is put a mechanism in place for opening this new window from our main application window. For this, we will edit the ApplicationWindow.js
file and add the following event handler to the button named btnPortfolio
.
In our click
event, we will load the contents of the PortfolioWindow.js
file using the require
function and store this content in a variable just as we did the last time. Then, we will invoke a new instance of our portfolio window, and display it using the open
function. Finally, we want the window to have a flip transition from the left when it appears.
Note
The window transitions are iOS specific. Although the code won't have any impact on Android at runtime, you will see an error in the logs.
The flip transition can be implemented as follows:
btnPortfolio.addEventListener...