PDA

View Full Version : Ext Menu and YUI 2.2.0 Slider bug?



Ian
23 Mar 2007, 7:13 AM
I'm getting an error when using a YUI Slider bar in the same page as my Ext Menu. I'm using the latest Ext build. Ext Menu is throwing:

li.getRegion().adjust is not a function

when I mouse-over an enabled Menu item. It does not occur when I mouse-over a disabled Menu item.

The salient code where it errors is:
this.region=li.getRegion().adjust(2,2,-2,-2);

in ext-all.js in the Ext.menu.BaseItem=function... section. I've gotten around it by wrapping a try/catch around the code, but thought I'd post it. I'm sure it has something to do with YUI stuff trampling on Ext stuff. FWIW, though an error gets thrown, it doesn't seem to change the behavior in any noticeable way if I just catch the error and do nothing with the exception.

Ian

tryanDLS
23 Mar 2007, 7:41 AM
That sounds like a bug in your code. Use a debugger and verify that li is a valid layout. The fact that it's telling you adjust is not a function of a region says you don't really have a ref to a region.

Ian
23 Mar 2007, 11:06 AM
That sounds like a bug in your code. Use a debugger and verify that li is a valid layout. The fact that it's telling you adjust is not a function of a region says you don't really have a ref to a region.

That could very well be, but the fact that:

- No YUI 2.2.0 JavaScript includes = Everything works great as it has for weeks, while
- Inclusion of YUI 2.2.0 JavaScript includes = Error on Menu mouseovers

would suggest to me that there is some sort of underlying collision between Ext and YUI 2.2.0. There is no Layout on the page, regardless, the Region code in question appears to be about offsetting the Menu item on mouseover.

brian.moeskau
26 Mar 2007, 2:32 PM
What is your include order?

Ian
3 Apr 2007, 9:02 AM
My include order is:


<script language="javascript" type="text/javascript" src="JavaScript/Ext/yui-utilities.js"></script>
<script language="javascript" type="text/javascript" src="JavaScript/Ext/ext-yui-adapter.js"></script>
<script language="javascript" type="text/javascript" src="JavaScript/Ext/ext-all.js"></script>

...

<script type="text/javascript" src="http://yui.yahooapis.com/2.2.0/build/yahoo-dom-event/yahoo-dom-event.js" ></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.2.0/build/dragdrop/dragdrop-min.js" ></script>
<script src = "http://yui.yahooapis.com/2.2.0/build/slider/slider-min.js" ></script>



Problem doesn't present itself though until the actual mouseover.

Ian

jack.slocum
3 Apr 2007, 10:10 AM
You are overwriting classes Ext has extended (like Region) when including YUI after Ext. Have you tried removing the yui-utilties.js and including the utilities.js ship with 2.2 in place of the older Ext copy?

jack.slocum
3 Apr 2007, 10:19 AM
Ext is now upgraded to 2.2, so no need to duplicate any files. In the next release, you should work just fine.

TopKatz
5 Apr 2007, 6:59 AM
Im having this same problem:
see here :http://extjs.com/forum/showthread.php?t=4214

I tried using the latest utilities.js from yui and it did not fix the problem. Any other thoughts on this. Did the OP ever resolve the issue?

Katz