Another dynamic solution to show / hide grid header in extjs
I have a grid which is heavily reused in many views of the app, with and without the header. I needed it to be configurable from the outside, so in my MyGridPanel class I've set a variable:
Code:
showGridHeader: false // do not display grid header by default
The following code adds CSS class to hide the grid in initComponent method:
Code:
if (!this.showGridHeader) {
this.addClass('grid-no-header');
}
In CSS, I have following:
Code:
.grid-no-header .x-grid3-header
{
display: none;
}
So now all grids will have no headers by default but I can easily make a particular grid instance to have the header by setting it's public showGridHeader property to true. I hope this will help someone ;)
Hiding Grid Header in Ext 3.0
When I am trying to execute the above code, it is hiding the header but in IE it is showing scrollbars in the grid. I think it is not able to set the width of the grid properly. How can I fix this problem?
If I set hideHeaders to true in grid config then this scrollbar problem is gone and also it hides the header in IE but my grid is not able to load data in firefox. The grid store has data but still my grid in empty in firefox. My grid is inside a tabpanel in Ext 3.0. Does anybody know why hideheaders is causing problem in firefox for tabpanel?