Empty ListView

3 posts, 1 answers
  1. mg1970
    mg1970 avatar
    5 posts
    Member since:
    Dec 2012

    Posted 31 Jan 2013 Link to this post

    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>
        end list

    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

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


    It does not matter binding an object or null.
  2. Answer
    Alexander Valchev
    Alexander Valchev avatar
    2887 posts

    Posted 04 Feb 2013 Link to this post

    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!
  3. mg1970
    mg1970 avatar
    5 posts
    Member since:
    Dec 2012

    Posted 04 Feb 2013 Link to this post

    Thanks Alexander. That did the trick!
    I'll remove all "kendo.bind"s in the mobile app
Back to Top