user3293561
user3293561

Reputation: 1

how to add a row at the end of kendu grid which shows total

I have searched a lot but I haven't found solution.

Is there any way to add a row(as a last row) with totals for each column in kendu grid?

Upvotes: 0

Views: 720

Answers (1)

Atanas Korchev
Atanas Korchev

Reputation: 30661

You need to set the footerTemplate of the grid columns. Then use aggregates. Here is a running code snippet:

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name" },
    { field: "age",
      footerTemplate: "Min: #: min # Max: #: max #"
    }
  ],
  dataSource: {
    data: [
      { name: "Jane Doe", age: 30 },
      { name: "John Doe", age: 33 }
    ],
    aggregate: [
        { field: "age", aggregate: "min" },
        { field: "age", aggregate: "max" }
    ]
  }
});
</script>

Upvotes: 1

Related Questions