Note that there are some explanatory texts on larger screens.

plurals
  1. POMaintain a stack of Marionette ItemViews within a Marionette Layout
    text
    copied!<p>I would like to know if it possible to extend in some way the mechanism Marionette <code>Layout</code>s are based on creating a sort of stack like navigation.</p> <p>Marionette behaviour.</p> <p>Before a region <code>show()</code>'s a view it calls <code>close()</code> on the currently displayed view. <code>close()</code> acts as the <code>view</code>'s destructor, unbinding all events, rendering it useless and allowing the garbage collector to dispose of it.</p> <p>My scenario.</p> <p>Suppose I have a sort of navigation mechanism where a <code>Layout</code> acts as controller and first displays an <code>ItemView</code> called A, then a click somewhere allows to switch to <code>ItemView</code> B. At this point, an action on B (like for example a tap on a back button) allows to return to A <strong>without recreating it</strong>.</p> <p>How is it possible to achieve the previous scenario without creating again A <strong>and</strong> maintaning its state?</p> <p>For iOS people, I would like to mimic a sort of <code>UINavigationController</code>.</p> <p>Any advice?</p> <p><strong>EDIT</strong></p> <p><strong>My goal is to restore a prev cached view with its state without creating it again.</strong></p> <p>My scenario is the following. I have a layout with two regions: A e B. I do a click somehere within A and A and B are closed to show C and D. Now a back click would restore A and B with their states. Events, models, etc...but since views are closed events are removed.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload