PDA

View Full Version : Image reference to YUI-EXT site in yutil.js



Luc
7 Jan 2007, 1:23 PM
Hi,

While experimenting with TreePanel in 0.40, I noticed that browser generates many requests for
http://www.yui-ext.com/blog/images/s.gif

This may be due to the following line in yutil.js:

YAHOO.ext.BLANK_IMAGE_URL = 'http:/'+'/www.yui-ext.com/blog/images/s.gif';
I am new to this stuff, but I suppose there should be no hard-coded references to the YUI-EXT site in the library? Or is there another reason? Thanks for clarifying.

jack.slocum
8 Jan 2007, 10:26 AM
You need to set that to a blank image url on your server. When the official release comes I plan on going over it. In a nutshell, that allows for inline elements with css background images and a fixed size, which is a must for the tree and is being used in Grid 2. In the past I used various browser specific hacks (not always reliable), but this makes it a snap.

vtswingkid
15 Jan 2007, 8:57 AM
Rather than modifying the yui-ext library ourselves, could we provide a way to preconfigure with javascript prior to loading it. For example, we could define the variable YAHOO.ext.BLANK_IMAGE_URL='localurl'. When yui-ext.js loads it could varify that the variable is defined and show an alert if not. I personally would prefer not to have to modify the yui-ext js files directly.

Animal
15 Jan 2007, 9:03 AM
Well, no, you postconfigure it.

Set that variable in your code after yui-ext sets it!

vtswingkid
15 Jan 2007, 9:37 AM
if I set the variable after loading the entire yui-ext.js file the tree library has already used it. and changing the variable makes no difference according to firebug.

i suppose I could load yutils.js first and then individually load the rest. That is alot of files to get in the right order though.

Here in lies the problem....

YAHOO.ext.tree.TreeNodeUI.prototype = {
emptyIcon : Ext.BLANK_IMAGE_URL,

this gets set before there is time to change the value of BLANK_IMAGE_URL

jack.slocum
15 Jan 2007, 11:31 AM
On next check in that will be corrected.

jmakeig
19 Jan 2007, 1:27 PM
In the meantime, you can get around this by first setting the Ext.BLANK_IMAGE_URL constant and then setting the TreeNodeUI.prototype.emptyIcon. Here's what I have in my post-config:

Ext.BLANK_IMAGE_URL = '/assets/img/placeholder.gif';
Ext.tree.TreeNodeUI.prototype.emptyIcon = Ext.BLANK_IMAGE_URL;
(By post-config, I mean a JS file that loads after yutil.js.)