Pablo
Pablo

Reputation: 2386

JQM RC2 data-role="header" not styling with dynamic load

Neither my simple 'header' or 'footer' gets styled: all the other widgets (controlgroups, collapsible-sets, list etc) style as expected.

I'm reloading everything in the data-role="page" and then rebuilding the page like

$("#standings").load(url, function (content, status) {
        $("#standings").trigger("create");
        $.mobile.hidePageLoadingMsg();
});

Everything in the data-role='content' styles fine on load. I have two 'controlgroups' outside of the content that style correctly but neither the header or footer pick up any styling.

Upvotes: 0

Views: 629

Answers (1)

Littm
Littm

Reputation: 4947

I think you should use trigger("pagecreate") instead of trigger("create")... even if this is usually not recommended... :S

So, you'll get something like this:

$("#standings").load(url, function (content, status) {
        $("#standings").trigger("pagecreate");
        $.mobile.hidePageLoadingMsg();
});

I thougth you may wanna have a look at this link: https://github.com/jquery/jquery-mobile/issues/2703


Otherwise, you can try to apply the classes directly to your header.

Check this link for more infomation: JQuery Mobile trigger('create') command not working


Hope this helps.

Upvotes: 1

Related Questions