View Full Version : Redraw grid when State has changed

19 Oct 2010, 3:31 PM
How do I get a stateful component to redraw when its state (as stored using Ext.state.Manager et al) has been changed?

I've got an EditorGridPanel and am using a subclass of CookieProvider to also save its state cookies to my server for each user (so the user's configuration of the grid goes with them between machines). There's a shared 'default' state of the grid; users can replace their own current state with the default state (and privileged users can set the default state to match theirs). But, I can't find how to make the grid redraw (show/hide columns, change their order and widths, etc.) based on the changed state. (The grid is in a <div> of an existing application page, not inside an Ext.Container.) getView().refresh() doesn't seem to do anything; reconfigure() seems inappropriate (since the data in the store hasn't changed). Is there an event to be fired? (Tried having my state provider fire 'statechange'; that didn't seem to do anything, either.)

Apologies if this is naive question; I'm relatively new to Ext.js.

19 Oct 2010, 11:30 PM
You could try fireing a configchange event from the columnmodel (or call grid.getView().onColConfigChange directly).