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

How to: Display grouped data from datasource using listview Template

1 Answer 140 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Wilver
Top achievements
Rank 1
Wilver asked on 29 May 2013, 09:34 PM
Hello Telerik,
I have a kendo datasource that will load the following json data

[{"pedidoId":1,"supervisorId":"manuel","vendedorId":"1","clienteId":"1","total":12345.0000,"hora":"12:00"},{"pedidoId":2,"supervisorId":"manuel","vendedorId":"1","clienteId":"1","total":54321.0000,"hora":"12:06"},{"pedidoId":3,"supervisorId":"luis","vendedorId":"2","clienteId":"2","total":4521.0000,"hora":"12:10"}]

Using Mobile ListView Template, I want to display only the grouped data, for example:
<li>supervisorId = manuel, Total = 66666 </li> (that is the result of 12345+ 54321
<li>supervisor Id = luis, Total = 4521 </li>

Please refer to my attach files for the complete code.

Thank you for your help.

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 31 May 2013, 08:30 AM
Hi Wilver,

I am afraid that what you would like to achieve is not supported. As an alternative solution I suggest to display the group sum aggregate in the headerTemplate of the ListView. For example:
$("#VwPedidos_PedidosSupervisores").kendoMobileListView({
    template: kendo.template($("#tmp").html()),
    headerTemplate: "#: value # #: aggregates.total.sum #",
    dataSource: pedidosDb
});

I hope this will help.

Regards,
Alexander Valchev
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
Wilver
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or