Karthik Doijode Karthik Doijode -4 years ago 117
Javascript Question

How to get hidden columns field name from Kendo Grid object in JavaScript

I am trying to get hidden columns field names from Kendo Grid in JavaScript. Is there any way to get all hidden column filed names?

Answer Source

Each column of the grid has a hidden attribute. You can access the columns and build an array of field items if the hidden attribute is true:

var grid = $("#grid").data("kendoGrid");
var columns = grid.columns;

var hiddenFields = [];
for(var i = 0; i < columns.length; ++i) {
  if(columns[i].hidden) {      
    hiddenFields.push(columns[i].field);
  }
}

Dojo example to demonstrate.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download