Pramod Thakur

Pramod Thakur

  • 247
  • 6.8k
  • 2.2m

Not able to bind Kendo ListView

Mar 18 2015 9:39 AM
Hi, 


I am new to kendo UI controls. I am trying to bind kendo ui listview. But not able to do that.
Can any one please help.


div class="demo-section">
        <div id="listView"></div>
        <div id="pager" class="k-pager-wrap"></div>
    </div>
    @section scripts{
        <script type="text/x-kendo-template" id="template">
            <div class="product">
                <h3>#:Id#</h3>

            </div>
        </script>

        <script>
            $(function () {
                var dataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "/Subscription/Subscription/PurchaseDetailSubscription?CustomerId=6115258427",
                            dataType: "json"
                        }
                    },
                    pageSize: 5,
                });

                $("#pager").kendoPager({
                    dataSource: dataSource
                });

                $("#listView").kendoListView({
                    dataSource: dataSource,
                    template: kendo.template($("#template").html())
                });
            });
        </script>
    }