JSFiddle - React, Tailwind, and code Playground

by valchev

HTML

<script src="http://cdn.kendostatic.com/2012.2.710/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.default.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.mobile.all.min.css">
<div id="grid"></div>

JavaScript

var data = [
    {id: 1, foo: "A", bar: "Item1"},
    {id: 2, foo: "A", bar: "Item2"},
    {id: 3, foo: "B", bar: "Item3"},
    {id: 4, foo: "A", bar: "Item4"},
    {id: 5, foo: "B", bar: "Item5"},
    {id: 6, foo: "B", bar: "Item6"},
    {id: 7, foo: "A", bar: "Item7"}
];

$("#grid").kendoGrid({
    dataSource: {
        data: data,
        schema: {
            model: {
                fields: {
                    id: { type: "number" },
                    foo: { type: "string", editable: false },
                    bar: { type: "string" }
                }
            }
        },
        aggregate: [ 
            { field: "bar", aggregate: "count" },
            { field: "foo", aggregate: "count" }
        ]
    },
    groupable: true,
    columns: [
        {
            field: "id",
            width:150
        },
        {
            field: "foo",
            width:250,
            aggregates: ["count"],
            groupFooterTemplate: "Count: #= count #",
            footerTemplate: "Total count: #= count #"
        },
        {
            field: "bar",
            width:250,
            footerTemplate: "Total count: #= count #"
        }
    ],
    dataBound: function(e) {
        //set the initial scroll
        $("#grid").find(".k-grid-footer-wrap")
            .scrollLeft($("#grid").find(".k-grid-content").scrollLeft());
        
        this.content.bind('scroll', function () {
            $("#grid").find(".k-grid-footer-wrap").scrollLeft(this.scrollLeft);
        });
    }
});