Dynamic content multitemplate page
Hi all,
I've a multi-template page with 2 pages.
The first contains a listview of element loaded dinamically by a json.
When a list item is clicked, I have to show the second page with another listview, with the items related to che clicked item.
I'm able to create correctly the view, but when I click the back button and choose another item, the second page also contains the items of the old page.
I've tried to use $("#list").empty(); but when i load the second page for the second time, jquerymobile doesn't load the css correctly.
How can I correct this bug?
Another question.
If I create another file.html for the second page and I use the method
- $.mobile.changePage( file.html, {
- data: data,
- transition: "slide",
- changeHash: true,
- reloadPage: true
- });
And in the file.html I initialize the contens in the method
- $( document ).bind( "pageload", function( event, data )
when I click the back button and choose another item, I've the same problem, and are loaded the contents for the old view and the new view.
Thanks all,
Stefano