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

Empty ListView

2 Answers 171 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
mg1970
Top achievements
Rank 1
mg1970 asked on 31 Jan 2013, 08:27 PM
One of the ListViews displays no content when applying a template. For example, this section:

<script type="text/x-kendo-template" id="tmpl_jailcard_comment">
    begin list
    <ul data-role="listview" data-style="inset" data-type="group" >
        <li id="Item-A">AAA</li>
        <li id="Item-B">BBB</li>
        <li id="Item-C">CCC</li>
    </ul>
    end list
</script>

Produces no LI elements, only the enclosing UL element

When the UL attribute "data-role" is removed, the list displays the three items.
This might have to do with data binding, even though the above UL list does not work with dynamic data.

- bind data when calling the template from the view that uses the template: 
<span data-bind="source:this" data-template="tmpl_jailcard_comment"></span>
- bind data when navigating to the view:

kendo.bind("#scr_jailcard_comment", viewModel);
Any ideas what can cause this issue?

Attached is a stand-alone HTML file to reproduce the issue

EDIT:
On the following jsffiddle, the listview only displays when not binding any data to the view:

http://jsfiddle.net/elgato/CMCzC/7/

It does not matter binding an object or null.

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 04 Feb 2013, 01:05 PM
Hello Pythonquick,

Using kendo.bind in mobile application is not recommended - as you can see it is error prone.
The issue in your current case, is that the element with data-role="listview" is transformed into a KendoUI Web ListView widget. In order to avoid issues of that kind please bind the View content through the data-model configuration option (docs).

For your convenience I updated the jsFiddle example: http://jsfiddle.net/CMCzC/10/


All the best,

Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
mg1970
Top achievements
Rank 1
answered on 04 Feb 2013, 11:01 PM
Thanks Alexander. That did the trick!
I'll remove all "kendo.bind"s in the mobile app
Tags
ListView (Mobile)
Asked by
mg1970
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
mg1970
Top achievements
Rank 1
Share this question
or