Hybrid View
-
26 Jun 2012 1:37 AM #1
IE8 "Unresponsive Script" Prompt
IE8 "Unresponsive Script" Prompt
Hi,
Since upgrading to ExtJS 4.1, we are getting the "A script on this page is causing your web browser to run slowly" prompt in IE8 in places where we never saw it before.
We have a few places where form components are built up dynamically in loops, and these seem to be worse affected. Even simple things like live-search combo boxes are affected though.
The message comes up almost instantly without any delay.
These parts were all fine in ExtJS 4.0.7.
I know the message is related to the amount of lines of JavaScript statements to be executed. Therefore, since our code hasn't changed, I imagine the amount of statements in ExtJS 4.1 must've increased dramatically.
Is there anything at all we can do to sidestep this issue without having to attempt redesigns on our screens?
The weird thing is, if you dismiss the prompt, the screen continues to run perfectly fine at a very reasonable speed. However, the product isn't really in a fit state to sell with this prompt appearing everywhere.
Thanks...
-
26 Jun 2012 1:49 AM #2
If you're doing something like this:
It will trigger 100 layouts, which may cascade up. Instead, do something like this:Code:var ct = new Ext.container.Container({ renderTo: document.body }); for (var i = 0; i < 100; ++i) { ct.add({}); }
Similarly, if you're doing some kind of bulk operation on a view:Code:var ct = new Ext.container.Container({ renderTo: document.body }); Ext.suspendLayouts(); for (var i = 0; i < 100; ++i) { ct.add({}); } Ext.resumeLayouts(true);
Code:store.forEach(function(rec){ rec.set('someField', rec.get('someField') + 1); // triggers n row updates });Also see: http://www.sencha.com/blog/ext-js-4-1-performanceCode:store.suspendEvents(); store.forEach(function(rec){ rec.set('someField', rec.get('someField') + 1); // triggers n row updates }); store.resumeEvents(); grid.getView().refresh();Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
26 Jun 2012 1:54 AM #3
Brilliant, that seems like it would give us a huge performance boost too! Thanks so much for taking the time to write that! We'll try it out now.
-
25 Sep 2012 7:27 AM #4
Have you a feedback with these suggestions ?


Reply With Quote