2

Once again a question about extjs.

I use EXT 4.0.2 and have a couple of grids. How can i store the settings for the column width and position? Everytime i load the page everything is back to basic and that starts to annoy me :)

Thanks,

Toby

Rick Weller
  • 1,258
  • 9
  • 35
  • 54

1 Answers1

3

Add stateful: true statement to grid's config.

For this to work you also should enable state manager:

Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
    expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
}));
Molecular Man
  • 22,277
  • 3
  • 72
  • 89
  • Hey, thanks. This fix the position and visible or invisible...great. But column width is not working. is this because there is a forcefit? – Rick Weller Feb 02 '12 at 12:41
  • @TobyJustus, it looks like forcefit affects restoring the columns. But I can't say that it's not working completely([example](http://jsfiddle.net/molecule/LBbGP/embedded/result/)). Without forcefit - [everything is okay](http://jsfiddle.net/molecule/pKMxY/embedded/result/) – Molecular Man Feb 02 '12 at 13:05
  • thanks for the example. I will remove the forcefit. After all it is more important to select the width yourself then let the browser force it. Thanks! – Rick Weller Feb 02 '12 at 13:12
  • I've needed to add 'Ext.state.CookieProvider' to the class requires to make it work. – Aebsubis Jan 24 '14 at 18:10