I'm not sure whether others have noticed this as well or not. In couple of my cases, I noticed that when a column is hidden in the stored state and state is restored on a rendered grid, grid headers remain visible while content is hidden. I propose the following fix:
Code:
Ext.grid.GridPanel.override({
applyState : function(state){
var cm = this.colModel;
var cs = state.columns;
if(cs){
for(var i = 0, len = cs.length; i < len; i++){
var s = cs[i];
var c = cm.getColumnById(s.id);
if(c){
c.width = s.width;
var oldIndex = cm.getIndexById(s.id);
cm.setHidden(oldIndex, s.hidden);
if(oldIndex != i){
cm.moveColumn(oldIndex, i);
}
}
}
}
if(state.sort){
this.store[this.store.remoteSort ? 'setDefaultSort' : 'sort'](state.sort.field, state.sort.direction);
}
}
});