Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

page set to domCache: true has no effect after pagecreate event #4052

Closed
pandavault opened this issue Apr 16, 2012 · 5 comments
Closed

page set to domCache: true has no effect after pagecreate event #4052

pandavault opened this issue Apr 16, 2012 · 5 comments

Comments

@pandavault
Copy link

individual page set to domCache: true has no effect after pagecreate event when using pageContainerElement.page({ domCache: true })

Because binding to pagehide.remove is created on pagecreate event; any changes to the setting after is ignored.

Not sure if this is the expected behaviour.. It would be good if domCache setting of a page can be updated anytime before the page is removed.

@toddparker
Copy link
Contributor

Mind posting a test page for us to review? Template: http://jsbin.com/axicer/edit

@pandavault
Copy link
Author

i've setup a test here bit.ly/IocBDO

There's two buttons on the entry page:

  1. The first button calls changePage('page2.html'); on click; when the button on the page2 is clicked, the page's domCache is set to true before going back to previous page:
    history.back();

You can check by analysing the DOM that page2 is not cached in the DOM after we return to the first page. (I think the page should be cached if domCache is set to true anytime before pagechange.)

  1. The second button on click first adds an event handler on pagebeforecreate which sets the loaded in page's domCache to true.
            $(event.target).page({domCache:true});
    })

It then calls changePage('page3.html'). On click of page3's button just returns to the previous page.

Page3 is cached in the DOM when we return to the first page as the domCache is set to true at pagebeforecreate.

@agrberg
Copy link

agrberg commented Jul 10, 2012

I can confirm that I'm having the problem too. Is there a way to programmatically tell a page to not be cached? Sort of a pageContainerElement.page({ domCache: false }) but callable after some event on the page?

@jaspermdegroot
Copy link
Contributor

@gabrielschulhof - Is this a feature we can offer if we use _setOptions?

@jaspermdegroot
Copy link
Contributor

@pandavault

I added your request on the wiki page (https://github.com/jquery/jquery-mobile/wiki/Feature-Requests) in the "core" section. Closing this ticket as a feature request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants