View Full Version : grid layout != layout from state/SessionProvider.js

9 Aug 2011, 9:53 AM
ExtJS 3.4.0

I have an application that has several dynamicly-created grids, all configured similarly. They can each be altered to suit the user's needs. When updating a grid (show column, hide column, resize column, reorder columns, sort, etc.), I can see the cookie being updated in Firebug.

Prior to rendering the grid, I can see the state layout, via console.log (in the beforestaterestore listener), and it lists the proper state of the grid columns. However, the grid is not rendering as the layout specifies, but is configured according to the default column model declaration.

ie. load application, load a grid, hide a column
reload application, load same grid, column is still there, even though layout says hidden: true

The only differences I can see in the ColumnModel configurations echo'ing out to the console is that one has columns, sort and filters (beforestaterestore), and the other (render) only has columns and sort.

Any insight appreciated.

var grid = new Ext.grid.GridPanel( {
autoExpandColumn: "title"
,bbar: pager
,border: false
,cm: new Ext.grid.ColumnModel( {
columns: [...]
,defaults: { sortable: true, width: 90 }
} )
,frame: false
,id: sID
,listeners: {
beforestaterestore: function(grid,state) {
console.log( state ) ; // shows columns, sort and filters
console.log( Ext.appState[grid.id] ) ; // shows columns, sort and filters
,render: function(grid) {
console.log(grid.getState()) ; // only shows columns and sort
,rowdblclick: function() {...}
,plugins: filters
,region: "center"
,selModel: new Ext.grid.RowSelectionModel( {
listeners: {
rowselect: function(sm,ri,r) {...}
,singleSelect: true
} )
,stateEvents: [ 'columnmove', 'columnresize', 'reconfigure', 'sortchange' ]
,stateId: sID
,stateful: true
,store: store
,stripeRows: true
,viewConfig: {
enableRowBody: true
,forceFit: true
,getRowClass: function(record,rowIndex,p,store){...}
,width: "100%"
} ) ;

9 Aug 2011, 9:59 AM
Attached screen cap from firebug.

10 Aug 2011, 8:48 AM
No one has any thoughts?