jQuery Mobile .listview('refresh') not working

前端 未结 5 1152
有刺的猬
有刺的猬 2020-12-15 10:32

I\'m building a mobile web app with jQuery Mobile and I have a problem. I am using jQuery to parse an XML file and create list items. It builds the list, then apppends that

5条回答
  •  执笔经年
    2020-12-15 11:12

    My solution was to use no parameters in the listview method as in

    my playlist

    Back

    end then..

    $('#playlist').bind('pageshow', function () {
        doOnCallBack = function(){
            $('#playlist').find('[data-role="listview"]').listview();
        }
        ajaxGet('${genSecureLink(action:'updatePlaylistTemplate',controller:'ajaxActionsPd',absolute:'true')}',$('#playlist').find('[data-role="content"]'),doOnCallBack);
    });
    

    here is my function ajaxGet:

    function ajaxGet(url,target,doOnCallBack){
        $.ajax({
            url: url,
            error:function(x,e){handleAjaxError(x,e);},
            beforeSend:function(){$.mobile.showPageLoadingMsg();},
            complete:function(){$.mobile.hidePageLoadingMsg();doOnCallBack();},
            success:function(data, textStatus, jqXHR){target.html(data);}
        });
    }
    

提交回复
热议问题