Search code examples
onsen-uionsen-ui2

swap or shuffle Page


In myNavigator at present there are three pages: bottom.html, middle.html, and top.html. I want to get the bottom.html above the top.html and for that I am calling pushPage.

But there are two issues here:

  1. The stack looks like this bottom.html, middle.html, top.html, bottom.html.
  2. The new bottom.html is fully reconstructed, so it is wasting lots of resources in rebuilding the same content.

I tried resetToPage function but the issue is still same.


Solution

  • Since you have tagged Onsen UI 2 then you can use the bringPageTop method which seems to be doing exactly what you want. ^_^

    So you can do either of

    • myNavigator.bringPageTop(0)
    • myNavigator.bringPageTop('bottom.html')

    Good luck with your app!