PDA

View Full Version : Y.Dom.getViewportWidth is not a function



vishpool
5 Jun 2007, 10:03 AM
Y.Dom.getViewportWidth is not a function
../common/ext/adapter/yui/yui-utilities.js
Line 11

I am not sure why I am getting the above? I don't think I am missing any files. Tried searching but couldn't find the function definition anywhere??

Thanks!

tryanDLS
5 Jun 2007, 10:20 AM
What do your includes look like? Do you have both yui-utilities.js and ext-yui-adapter.js?

vishpool
5 Jun 2007, 10:24 AM
In this order...

<link rel="stylesheet" type="text/css" href="../common/ext/resources/css/ext-all.css"/>
<link rel="stylesheet" type="text/css" href="../common/ext/resources/css/ytheme-gray.css"/>
<link rel="stylesheet" type="text/css" href="css/results.css"/>
<link rel="stylesheet" type="text/css" href="css/ext.css"/>
<script type="text/javascript" src="../common/ext/adapter/yui/yui-utilities.js"></script>
<script type="text/javascript" src="../common/ext/adapter/yui/ext-yui-adapter.js"></script>
<script type="text/javascript" src="../common/ext/ext-all.js"></script>
<script src="http://simile.mit.edu/timeline/api/timeline-api.js" type="text/javascript"></script>
<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=YahooDemo"></script>

...followed by my extensions

vishpool
5 Jun 2007, 10:33 AM
Where should I find the function definition btw? I am greping the whole Ext package, and see a lot of references to it, but no definition?

tryanDLS
5 Jun 2007, 11:04 AM
Checking on what's going on with that - it's not used anywhere in Ext anymore except for the legacy Actor class. Are you using that? Or directly calling the yui getClientWidth and getClientHeight methods?

vishpool
5 Jun 2007, 11:13 AM
No, not me. But, it seems like Ext is...see attached.

My split/sliders don't even work, but I had them working. I only noticed it when I started using LayoutDialog.

tryanDLS
5 Jun 2007, 11:20 AM
What version of Ext are you using? I don't see a problem with 1.0.1a or 1.1 Beta and that line in BasicDialog always passes true, so it would never hit the missing function.

brian.moeskau
5 Jun 2007, 11:33 AM
It might be easier to track down if you switch to ext-all-debug.js temporarily and figure out what code is actually calling that method. You can set the "break on all errors" option in firebug and it will stop execution right where the exception is being raised.

vishpool
5 Jun 2007, 12:35 PM
I am not sure how to debug this, because it ends up in the *utilities.js (which isn't very friendly to read)...

See attached, hoping you could track something down...

Like I said previously, I did have it working, and I do have all the examples working fine...just weird...

brian.moeskau
5 Jun 2007, 1:05 PM
You appear to be running a mixture of incompatible code versions. According to the stack trace, you are calling your own showRecord function, which in turn calls BasicDialog.show. Internally, that raises an event that is handled by BasicDialog.beforeShow, and that's where this line is getting called:


this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));

Notice that in the current version of Ext (1.0+) it calls Ext.lib.Dom, while your version calls Y.Dom. This was the old way before the adapters existed when it was using YUI directly. You should upgrade all of your Ext files to the most current versions and this issue should go away.