ListView + data-type="group" + MVVM issue

4 posts, 0 answers
  1. Paul McNamara
    Paul McNamara avatar
    30 posts
    Member since:
    Apr 2010

    Posted 16 Oct 2013 Link to this post

    There appears to be an issue with nested bindings when the ListView is in grouped mode in 2013.2.918. It manifests itself as the first item in a group not binding properly (or first 2 if there are two top-level items etc). Is this a known issue? If not I can provide more detail.
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 16 Oct 2013 Link to this post

    Hi Paul,

    this does not sound like a known issue. If possible, please provide more details about the problem - we will take a look right away. 

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Paul McNamara
    Paul McNamara avatar
    30 posts
    Member since:
    Apr 2010

    Posted 16 Oct 2013 Link to this post

    FYI, I've worked around this for now by using multiple group list views with one <li> each but the below example does fail.

    The markup looks like this (inside a data-role="view" ofcourse):

    <ul data-role="listview" data-type="group" data-style="inset" data-bind="source: Groups" data-template="GroupTemplate">
    </ul>

    <script id="GroupTemplate" type="text/x-kendo-template">
    <span data-bind="text: Name"></span>
    <ul data-role="listview" data-bind="source: Items" data-template="ItemTemplate">
    </ul>
    </script>
    <script id="ItemTamplte" type="text/x-kendo-template">
    <span data-bind="text: Name"></span>
    </script>

    Viewmodel data looks like:

    var data = {
    Groups: [
    {
    Name:"Group1",
    Items: [
    {Name:"Item1"},
    {Name:"Item2"},
    {Name:"Item3"},
    ]
    },
    {
    Name:"Group2",
    Items: []
    }
    ]
    }
  5. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 17 Oct 2013 Link to this post

    Hello Paul,

    Thank you for the provided example. I am afraid that this approach is not supported. In order for the listview to be in grouped databound mode, it should be bound to a grouped datasource (like this demo). 

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready