View Full Version : Treepanels firing event twice

9 Jul 2013, 6:18 AM

I have a user control (asp.net 2.0 framework and using ext js ver 4.2.0) that has 2 treepanels displaying different data stores and having different models. Using IE 8 here. When the page loads for first time, both trees display fine. But when browser refresh button is clicked, it loads the trees twice. It seems to be firing onReady event twice.

Treepanel 1 - uses ScriptA.js which invokes ScriptA_Handler.ashx.cs
Treepanel 2 - uses ScriptB.js which invokes ScriptB_Handler.ashx.cs

ScriptA.js and ScriptB.js each have onReady event defined.

When I test this same in Chrome (ver 27.0), it does not fire the events twice. It works just fine. The problem is only in IE.

Any pointers here will be helpful!


11 Jul 2013, 12:31 PM
Are you waiting to lay out the components until after the onReady event? Normally that's the way to proceed - just wait for the the onready event to fire the first time and then launch into your application code using the ExtJS library. *normally not listening for the event beyond that first firing.

Speaking of launch, if you're using an Ext.application() instance as your entry point you can kick off all of your application logic within the application's launch method - which doesn't run until the browser's DOM is ready.