onsen ui - How does one navigate between pages while maintaining state whilst using <ons-navigator>? -


i have 3 main pages: list (of businesses), search, , favourites. list page users can drill down details business.

i using <ons-navigator>. navigating list details , list working expected since using <ons-back-button>. list page state maintained since onsen-ui doing poppage().

my question how navigate list favourites or search while maintaining list state? right using pushpage() keeps adding pages stack. don't think that's how it's supposed work , practically speaking if push page page stack , exists... shouldn't added rather should moved top. idea.

my code:

<ons-navigator var="app.navi" page="list.html"></ons-navigator>  <ons-template id="list.html">     <ons-page id="list-page">         <ons-toolbar>             <div class="center">near me</div>         </ons-toolbar>         <ons-list></ons-list>     </ons-page> </ons-template>  <ons-template id="search.html">     <ons-page id="search-page">                 <ons-toolbar>             <div class="center">search</div>         </ons-toolbar>     </ons-page> </ons-template>  <ons-template id="favourites.html">     <ons-page id="favourites-page">         <ons-toolbar>             <div class="center">favourites</div>         </ons-toolbar>     </ons-page> </ons-template>  <ons-template id="detail.html">     <ons-page id="detail-page">                     <ons-toolbar>             <div class="left">                 <ons-back-button>back</ons-back-button>             </div>         </ons-toolbar>         <ons-list></ons-list>     </ons-page> </ons-template>  <ons-template id="sub-detail-page.html">     <ons-page id="sub-detail-page">         <ons-toolbar>             <div class="left"><ons-back-button>back</ons-back-button></div>             <div class="center">sub detail page</div>         </ons-toolbar>     </ons-page> </ons-template>  $( $lstelmnt.children('.item'), ).on( 'click', function() {     currentitem = getestablishment( $( ).attr( 'id' ), app.navi.pushpage( 'detail.html' ) );           }); 

other things have tried include carousel, tabbar, , plain old jquery.


Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -