Note that there are some explanatory texts on larger screens.

plurals
  1. POBackbone and jqm: back button how to restore page context
    primarykey
    data
    text
    <p>I'm building an HTML5 mobile application using Backbone, require and jQuery mobile as a technology stack. The application is really smoothy with a connection to a backend web service and so on. To Change between the pages I use jQuery changePage. To instanciate Backbone views I use the following strategy:</p> <pre><code>$( document ).delegate("#card-delivery-address", "pageshow", function(){ require(["js/views/cardDeliveryAddressViews.js" ], function(cardDeliveryAddressViews) { new cardDeliveryAddressViews(); }); }); </code></pre> <ol> <li><p>$.mobile.changePage('deliveryAddress.html') => changes the current page using jquery mobile</p></li> <li><p>When an event called "<em>pageshow</em>" is fired on <em>#card-delivery-address</em> (which means that my page was inserted in the DOM and successfully rendered) => create the backbone view and bind the $el to an existing DOM and taking control on the DOM events using backbone views.</p></li> <li>To pass data and instances between views we use a window.tempData global variable in which we put the context data so that the new view will know what to do.</li> </ol> <p>Doing one way navigation is successful, suppose that I come from view1 --> view2 (with tempData) then from view2 --> view 3 (override the same tempData). Now, and here is my problem: if we want to go back from view 3 --> view 2 we will need the tmpData content that we used to initialize and render the view 2. The same thing when we want to go back to view1. </p> <p>Note: I'm not using backbone router but I can change to use it if that will solve my problem.</p> <p>Any ideas guys?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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