Our blazing fast Grid component built with pure JavaScript


Post by prashantgoel »

Is there a quick way to check and hide columns that have no data in them?


Post by tasnim »

Hi,

Not sure what you mean by "quick way to check", could you please explain a bit further about it?
You can hide column with https://bryntum.com/products/grid/docs/api/Grid/column/Column#function-hide method

grid.columns.get('field').hide();

Docs
https://bryntum.com/products/grid/docs/api/Grid/data/ColumnStore#function-get


Post by prashantgoel »

Sorry, what I meant to ask was is there a way to check if a particular column has any data besides traversing through each row for each column? I am aware of the hide() function and that works well, but we want to give the ability to hide any columns that don't contain any data. Some of our data grids may contain 10s of columns.


Post by mats »

No, you'd have to loop over all records to check that I'm afraid. There's also the autoWidth config which might be somewhat helpful in your case.


Post Reply