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

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

3 Answers 109 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Paul McNamara
Top achievements
Rank 1
Paul McNamara asked on 16 Oct 2013, 02:34 PM
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.

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 16 Oct 2013, 02:57 PM
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!
0
Paul McNamara
Top achievements
Rank 1
answered on 16 Oct 2013, 03:07 PM
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: []
}
]
}
0
Petyo
Telerik team
answered on 17 Oct 2013, 01:31 PM
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!
Tags
ListView (Mobile)
Asked by
Paul McNamara
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Paul McNamara
Top achievements
Rank 1
Share this question
or