방금 Meteor 0.8로 업그레이드하고 데이터가 표시되지만 jQuery-Mobile 스타일이 적용되지 않는 것을 의미하는 내 listview 새로 고침을 발견했습니다. 저는 1.4.2를 사용하고 있습니다. 이것은 메테오 0.7.2와 잘 맞았습니다 :Meteor 0.8 업그레이드가 jQueryMobile ListView 새로 고침에 영향을 받음
Template.requests.rendered = function(){
if ($('[data-role="listview"]')) {
$('[data-role="listview"]').listview().listview("refresh");
}
}
누구도이 동작을보고 수정 사항을 알고 있습니까? 문제는 템플릿 렌더링 이벤트가 진정으로 아직 렌더링되지 않은 데이터입니다 것으로 보인다
<template name="requests">
<div id="listview-content">
<ul data-role="listview" data-autodividers="false" data-filter="true" data-inset="true">
{{#each items}}
<li><a href="#listdetail" data-name="{{RequestedFor}}" data-transition="slide">{{RequestedFor}}<br><span
class="small">Requested new {{RequestedItem}} on {{formatDate dateSubmitted "short"}}</span></a>
</li>
{{/each}}
</ul>
</div>
</template>
아직 없다 무언가에리스트 뷰 새로 고침을하려고, 그래서 :
이처럼 내 템플릿 모습입니다 . 지금, 나는이 해킹을 수행하지만 내가 물론 유지하려는 것이 아니다 :
Template.requests.rendered = function(){
Meteor.setTimeout(function() {
if ($('[data-role="listview"]')) {
$('[data-role="listview"]').listview().listview("refresh");
}
}, 300); //Must be >= 300ms to render the listview properly
};
새로운 'ul'을 추가하려면'.listview()'만 사용하십시오. 기존의'ul'에'li'을 추가한다면'.listview ("refresh")'만을 사용하십시오. – Omar
두 가지 모두 시도했지만 목록보기가 아직 표시되지 않아 작동하지 않습니다. listview를 볼 수있게 된 후이를 수행 할 방법이 필요하다. 문제는 유성으로 그 일을 할 수있는 방법을 찾지 못하는 것입니다. – occasl
오류가 있습니까? – Kshitiz