PDA

View Full Version : grid reconfigure events



pex
4 Jul 2007, 2:10 AM
Hello,

I use grid.reconfigure(ds, cm) to display my grid with a different store/columnModel - and it works nicely. However, it does some weird things to the event handlers it seems. The sortable headers fire 1 more time that usual every time I run reconfigure() - so if I run reconfigure 3 times the sortable header fires a POST request 4 times instead of...1 :)

Im using the latest public download, Ext.1.1beta2

Thanks for any suggestions or if this is indeed a bug, thanks for noting it!

mystix
4 Jul 2007, 2:13 AM
before calling reconfigure(), try purging all listeners for the old ColumnModel and Store first.

pex
4 Jul 2007, 3:23 AM
I tried your suggestion with purgeListeners - but it didn't help. Here is what I did:



this.grid.colModel.purgeListeners();
this.grid.dataSource.purgeListeners();
this.grid.reconfigure(newds, newcm);

this.grid.render();
this.grid.loadData();


Update: I figured that the this.grid.render() method re-adds the event handlers, so I dissed that and it works FINE now! :)

mystix
5 Jul 2007, 7:11 AM
ah yes. shouldn't have to call grid.render() since the grid is already rendered.

simply calling the Store's load / reload method should trigger the Grid's view to do a refresh.