PDA

View Full Version : [Solved] Ext JS bug in 3.2.1 beta2??? Answer: CSS typeo



aw1zard2
13 Aug 2010, 5:22 PM
I have a complex layout using grouptabs and have used it for Ext JS 3, 3.1,3.2, and testing 3.3.
We recently added a new Dataview on one of the tab panes within the grouptab.
IE wouldn't show it at all but Safari, Firefox, Chrome, and Opera would.

So I went digging and IE kept reporting ext-all.js had the error.
So further digging down I found this bit of code.


setStyle : function(prop, value){
var tmp, style;

if (typeof prop != 'object') {
tmp = {};
tmp[prop] = value;
prop = tmp;
}
for (style in prop) {
value = prop[style];
style == 'opacity' ?
this.setOpacity(value) :
this.dom.style[chkCache(style)] = value;
}
return this;
},

If I comment out this line IE shows the DataView but it changes the layout a little on everything else.
I am still searching for another line like that one and so far haven't found one. The line starts on 4272 in ext-all-debug.js for Ext JS 3.2.1 or line 2349 in ext-all-debug.js for Ext JS 3.3.0 Beta 2 7080.

Is this a Ext JS bug?

Animal
14 Aug 2010, 12:05 AM
That line is absolutely central. It actually does the style setting.

if you comment it out, no style setting will work.

If there was a bug it would manifest everywhere all the time.

When you set it to "Break on all errors", and the error fires, what are the values there? I suspect you are passing a value which triggers a problem.

aw1zard2
14 Aug 2010, 5:54 AM
I finally tracked down what was causing it. It was in a css file we had a _ instead of a - for margin-left:.
Which made it very hard to find.

Finally did an alert in the setStyle which finally showed which one was bombing out then had to hunt for it.

Thanks for the reply Animal.

I was scratching my head on this one.

Animal
14 Aug 2010, 5:57 AM
Why do you waste so much time when the tools are available to you to just find these problems?

Set "Break on all errors".

When it breaks, walk back through the call stack and you'll find the code which started the invalid value.

It's a job of 2 minutes.

aw1zard2
14 Aug 2010, 6:20 AM
IE was only showing the error with ext-all.js and nothing else. Cause the dataview was on the 2nd tab the error wasn't showing until we activated that tab.

Animal
14 Aug 2010, 7:12 AM
Eugh! That's frustrating! IE8's debugger is geologically slow when navigating large files! It may have taken you longer to use the debugger on it!