我正在创建一个新的剑道移动应用程序,并且我一直在尝试通过单击将 Wordpress 帖子绑定到列表视图以加载更多功能。我似乎无法让它发挥作用。请我在这方面需要一些帮助。
<div data-role="view" id="home" data-layout="main-layout" data-title="MaskJams" data-init="mobileListViewPressToLoadMore">
<header data-role="header">
<div data-role="navbar">
<span data-role="view-title"></span>
</div>
</header>
<ul id="load-more"></ul>
<script type="text/x-kendo-tmpl" id="load-more-template">
<div class="product">
<img src="#=data.posts.thumbnail_images.medium#" alt="#:data.posts.title#" class="pullImage"/>
<h3>#:data.posts.title#</h3>
</div>
</script>
<script>
function mobileListViewPressToLoadMore() {
var dataSource = new kendo.data.DataSource({
type: "json",
transport: {
read: {
url: "http://www.maskjams.com/api/get_recent_posts/?callback=callback"
}
},
serverPaging: true,
pageSize: 20
});
$("#load-more").kendoMobileListView({
dataSource: dataSource,
template: $("#load-more-template").text(),
loadMore: true
});
}
</script>
</div>