I have a grid which i want to hide the columns when they are grouped and show them when are removed from our group panel. is there any other way than looping through all columns to show(commented code).
dataBound: function (e) {
// this function (event) runs when kendo grid gets new data that get bound
var gridDataSource = e.sender.dataSource;
if (gridDataSource.group().length > 0) {
// for (var i = 0; i < this.columns.length; i++) {
// grid.showColumn(i);
// }
Ember.$("div.k-group-indicator").each(function (i, v) {
e.sender.hideColumn($(v).data("field"));
});
//the grid is grouped
Ember.$(".grouping-collapser").css('display', 'block');
e.sender.element.find(".k-icon.k-i-collapse").trigger("click");
} else {
Ember.$(".grouping-collapser").css('display', 'none');
}
}