user516883
user516883

Reputation: 9378

The event to to call when showing a dialog in jquery mobile

I have a jquerymobile application, some pages are heavy loading ajax network calls so I would like to show a dialog. I have it set up to but it very shows for some reason. So it looks like the page is just empty and not doing any work. Should I do my call on the pageinit function or pageshow? Thanks for any help.

 $('#MyAlbums').live('pagebeforeshow', function (event) {
             $.mobile.showPageLoadingMsg();
              var myselect = $("select#select-choice-1");
              myselect[0].selectedIndex = 0;
              myselect.selectmenu("refresh");
            GetMyAlbumInformation('full');
        });

Upvotes: 0

Views: 69

Answers (1)

Ohgodwhy
Ohgodwhy

Reputation: 50767

$(document).bind('mobileinit', function(){
  $('#MyAlbums').live('pagebeforeshow', function (event) {
    $.mobile.loadingMessage= ' The message I want to display ';
    $.mobile.showPageLoadingMsg();
    var myselect = $("select#select-choice-1");
    myselect[0].selectedIndex = 0;
    myselect.selectmenu("refresh");
    GetMyAlbumInformation('full');
   });
});

Upvotes: 1

Related Questions