Javascript: Find all the Grid Column Names

You can use querySelectorAll,

 var colHeaders = document.querySelectorAll('[role = ColumnHeader]');

It will select all the elements in the DOM with the given selectors.

Now to get all the name of the column header, you can do the following,

var colHeaderNames = [];
document.querySelectorAll('[role = ColumnHeader] > .k-link').forEach(item => colHeadersNames.push(item.innerText));

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top