3

I have the following Kendo UI Angular grid:

<kendo-grid id="engagementGrid" options="engagementGridOptions"></kendo-grid>

Controller:

$scope.engagementGridOptions = {
                dataSource: {
                    type: "json",
                    transport: {
                        read: "http://accountviewserver:8080/api/Engagement"
                    },
                    group: { field: "Name" }
                },
                sortable: true,
                height: 200,

                columns: [{
                    field: "Name",
                    width: "120px"
                },{
                    field: "Project",
                    width: "200px"
                },{
                    field: "StartDate",
                    width: "80px"
                },{
                    field: "EndDate",
                    width: "80px"
                },{
                    field: "PercentEngaged",
                    title: "% Engaged",
                    width: "50px"
                }]
            };

What is the proper Kendo / Angular syntax to make the group collapsed by default?

Andrea
  • 11,801
  • 17
  • 65
  • 72
Eugene Goldberg
  • 14,286
  • 20
  • 94
  • 167

1 Answers1

-1

For those that come upon this, add this to your grid options

dataBound: function () {
    var grid = this;
    grid.tbody.find("tr.k-grouping-row").each(function () { grid.collapseGroup(this); });
}
Machavity
  • 30,841
  • 27
  • 92
  • 100
Ulfius
  • 619
  • 7
  • 14
  • As happens a lot with Kendo answers, the question specifies an Angular solution (i.e. not jQuery). – Mike K Mar 15 '18 at 23:01
  • FYI, the answer I specified is one I'm using in my own Angular implementation, so I did answer the question. – Ulfius May 05 '18 at 07:04