Edit this page

Group Data

The example below demonstrates how to group data by the first letter of each item in a hybrid Kendo UI ListView.

Example
    <div id="home" data-role="view" data-init="onInit">
      <ul id="listview"></ul>
    </div>
    <script>
      var app = new kendo.mobile.Application();

      var groupedData = [
        {name: "Sashimi salad"},
        {name: "Chirashi sushi"},
        {name: "Seaweed salad"},
        {name: "Edamame"},
        {name: "Miso soup"},
        {name: "Maguro"},
        {name: "Shake"},
        {name: "Shiromi"},
        {name: "Tekka maki"},
        {name: "Hosomaki Mix"},
        {name: "California rolls"},
        {name: "Seattle rolls"},
        {name: "Spicy Tuna rolls"},
        {name: "Ebi rolls"},
        {name: "Chicken Teriyaki"},
        {name: "Salmon Teriyaki"},
        {name: "Gohan"},
        {name: "Tori Katsu"},
        {name: "Yaki Udon"}
      ];

      function onInit() {
        $("#listview").kendoMobileListView({
          dataSource: {
            data: groupedData,
            schema: {
              parse: function (data) {
                for(var i = 0; i < data.length; i++) {
                  data[i].letter = data[i].name.charAt(0);
                }
                return data;
              }
            },
            group: { field: "letter" }
          },
          template: "${name}",
          fixedHeaders: true
        });
      }
    </script>

See Also

Other articles and how-to examples on the Hybrid UI ListView:

For more runnable examples on the Kendo UI hybrid ListView, browse its How To documentation folder.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy