Search code examples
javascriptjquerywordpresskendo-uikendo-mobile

KendoUi & Wordpress data binding detail view


I have a list view of post from wordpress using kendoui mobile and jsonp. I am trying to get a detail view attached to it that would show the detail view the post clicked on. Please help.

Here is a link to this on jsbin http://jsbin.com/uKAFeMo/2/edit

<ul id="load-more"></ul>
<script type="text/x-kendo-tmpl" id="load-more-template">
    <div class="product">
        <img src="#=thumbnail_images.medium.url#" alt="#-title#" class="pullImage"/>
        <h3>#=title#</h3>

    </div>
</script>

<script>
    function mobileListViewPressToLoadMore() {
var dataSource = new kendo.data.DataSource({
  transport: {
    read: {
      url: "http://www.maskjams.com/api/get_recent_posts/?count=100",
      dataType: "jsonp"
    }
  },
  schema: {
    data: "posts"
  },
  serverPaging: true,            
  pageSize: 10
});

$("#load-more").kendoMobileListView({
  dataSource: dataSource,
  template: $("#load-more-template").text(),
    loadMore: false //When i set this to true it won't load any post. I don't know why?
});

    }
</script>

Solution

  • I had to switch to using MVVM style to get that accomplished.

    See jsbin http://jsbin.com/OTInERo/3/edit