PDA

View Full Version : updateElement Documentation bug



HorsMark
19 Dec 2006, 7:44 AM
Hi Jack

I guess this is a bug in the documentation...

url: http://www.jackslocum.com/deploy/yui-ext/docs/output/YAHOO.ext.UpdateManager.html

<snip>
updateElement<static>(String/HTMLElement/YAHOO.ext.Element el, String url, [String/Object params], [Object options]) : void UpdateManager
<static> Static convenience method, Usage:

YAHOO.ext.UpdateManager.update('my-div', 'stuff.php');
</snip>

As I can see usage should be:
YAHOO.ext.UpdateManager.updateElement('my-div', 'stuff.php');

furthermore it seems that the optional params ain´t optional :-)

Regards:
Jesper HorsMark

jack.slocum
19 Dec 2006, 12:59 PM
The doc error was fixed in svn. The optional problem is also corrected now. :)

jack.slocum
19 Dec 2006, 1:02 PM
One other note, a faster way to do the same thing:

getEl('el-id').load('foo.php', 'param1=4');

or with an object literal (see UM.update docs):

getEl('el-id').load({url: 'foo.php', text: 'Loading Foo...'});

HorsMark
27 Dec 2006, 10:35 PM
great !

Btw is there a updatemanager functionality which can handle multiple calls to borderlayout

problem:
I need to update west, center, east and south with different urls and in the meantime i want to disable the borderlayout... (grayed out with an ontop message "Please wait loading data...")

awesome work btw

Regards
HorsMark

jack.slocum
28 Dec 2006, 3:22 AM
Just overlay the body to disable it (the ydlg-mask class is from basic-dialog.css or yui-ext.css):

var bd = getEl(document.body);
var mask = bd.createChild({tag:'div', cls:'ydlg-mask'});
mask.show();

Then append a loading element above it:

var loading= bd.createChild({tag:'div', cls:'your-loading-css-class', html:'Loading, please wait...'});


your-loading-css-class will be a css class with (for example):
position:absolute;
left:47%;
top:47%;
background:white;
border:2px solid #c3daf9;
font:normal 13px verdana,tahoma,sans-serif;
z-index:10001;

If you looking the default load-indicator class, you can also pop in an animated gif css background image.