JqueryMobile에 몇 가지 문제가 있습니다. 페이지를로드하고 즉시 Listview를 만듭니다. 처음 페이지가로드 될 때 목록이 잘 렌더링됩니다. 이전 페이지로 돌아가서 동일한 링크를 클릭하면 목록보기가 링크처럼 렌더링되지 않습니다. 같은 문서에 여러 페이지가 있으므로 이드로 페이지를 참조합니다. 아래 코드.페이지가 두 번째로로드 될 때 목록보기가 올바르게 렌더링되지 않습니다.
목록이 작성됩니다.
function getDays(mon){
var total = 0;
$("#h1").text(sites);
$("#perDay").empty();
$.getJSON('/cf/cfc/statistics.cfc?method=PagesPerDay', { site: sites , months : mon}, function(qPress) {
$.each(qPress, function(i, item) {
total = total + item.pages;
$("#perDay").append('<li id="' + item.dayname +'"><a href="javascript:void(0);" onClick="getDays();">' + item.dayname + '<span class="ui-li-count">' + item.pages + '</span></a></li>');
});
$("#perDay").append('<li data-theme="b" class="ui-li ui-li-static ui-body-c ui-li-has-count">Total' + '<span class="ui-li-count">' + total + '</span></li>');
ChangePage("#pageDays", 'pop', sites);
});
}
HTML
<div data-role="page" id="pageDays">
<div data-role="header" data-position="inline">
<a href="#razzberry" data-icon="back" data-theme="b" data-rel="back">Back</a>
<h1 id="h1"></h1>
</div>
<div data-role="content">
<h4 style="text-align:center;">Pages Viewed Per Day</h4>
<ul data-role="listview" id="perDay"></ul>
</div>
</div><!-- /page -->
나는 루프 후 $("#perMonth").listview("refresh");
을 넣어 시도했지만 나는 catch되지 않은 초기화하기 전에 목록보기의 메소드를 호출 할 수 있어요; 내가 jQuery를 모바일 1.0
ChangePage를 올바르게 호출하지 않는 것 같습니까? docs : http://jquerymobile.com/demos/1.0/docs/api/methods.html 어쩌면 $ .mobile.changePage ("#pageDays", {transition : "pop"}); –
온라인으로 코드에 대한 링크를 게시 할 수 있습니까? – commadelimited