PDA

View Full Version : Loading Async'ly



techno_adi
5 Oct 2006, 10:28 PM
Hi,
I would like to load the content in the split-bar left panel dynamically..
lets say from an xml file.

Is there a way to do it..

Actually i want to templatize the page i am developing..

jack.slocum
6 Oct 2006, 12:41 AM
That's pretty broad, can you give me more details?

techno_adi
6 Oct 2006, 1:26 AM
Actually I have to give the split-bar title and its menu contents to be able to load from a xml file.
When my page loads, the split-bar should populate its content from xml file and till then it must have the loading symbol displayed ( a AJAX sort of functionality).

This would make my split-bar more generic..
And for different pages i would just require to change the xml file template to have different content..

I hope this makes it more clear..

Is this feasible? How to go about is?

jack.slocum
6 Oct 2006, 3:27 AM
Personally I would apply the template on the server, not the client. Then you can just use the the elements UpdateManager to load it:



var el = getEl('your-menu-container');
el.getUpdateManager().load('menu.php');


UpdateManager will show/hide the ajax loading indicator in the element automatically. You will need to add the CSS for the loading indicator. For an example, see the CSS for /forum2. The class is ".loading-indicator".

techno_adi
6 Oct 2006, 3:37 AM
Personally I would apply the template on the server, not the client. Then you can just use the the elements UpdateManager to load it:



var el = getEl('your-menu-container');
el.getUpdateManager().load('menu.php');


UpdateManager will show/hide the ajax loading indicator in the element automatically. You will need to add the CSS for the loading indicator. For an example, see the CSS for /forum2. The class is ".loading-indicator".

Thnx for that.
Just one more on this..I have very less idea about the php, so can you please tell me if i could do some thing like this:


var el = getEl('your-menu-container');
el.getUpdateManager().load('menu.xml');

Does php runs some database statements to send the output?
If so, i could use some .net code behind and return an xml file to load. will update manager be able to parse that ( like an XMLHTTPRequest i guess).

Also, to add on to this..
will the UpdateManager class be applicable to any YUI control ? I mean if i want to do the same for say menu control or may be tree control - Is this possible too?