This is a migrated thread and some comments may be shown as answers.

Data Binding using json in ListView

0 Answers 174 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Mayank
Top achievements
Rank 1
Mayank asked on 21 Sep 2012, 10:49 AM
Hi...I saw some examples on the internet regarding data binding using json in ListView but those things are not working in my case. I have a Controller named "Contact" and there is method named "Read", in Read () method I get the Contact list which I want to show in ListView in Mobile. Here is my View Code...


<div data-role="view" id="tabstrip-profile" data-title="Dashboard" data-layout="mobile-tabstrip"
    data-init="initListView">
    <ul data-role="listview" data-style="inset" data-type="group">
        <li>
            <ul id="contactList">
            </ul>
        </li>
    </ul> 

</div>
<script type="text/javascript">
var deviceJDS = new kendo.data.DataSource({
            transport: {
                read: {
                    contentType: "application/json; charset=utf-8",
                    type: "GET",
                    data: "{}",
                    dataType: "json",
                    url: "/Contact/Read"
                }
            },
            schema: {
                data: "d" 
            }
        });


        function initListView(e) {
            e.view.element.find("#contactList").kendoMobileListView({
template: "<strong>#:data.DisplayName#</strong>",
            dataSource: deviceJDS
            });

}

var app = new kendo.mobile.Application(document.body);

</script>

No answers yet. Maybe you can help?

Tags
ListView (Mobile)
Asked by
Mayank
Top achievements
Rank 1
Share this question
or