How to: Display grouped data from datasource using listview Template

2 posts, 0 answers
  1. Wilver
    Wilver avatar
    1 posts
    Member since:
    Mar 2013

    Posted 29 May 2013 Link to this post

    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.
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 31 May 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top