PDA

View Full Version : UpdateManager event on ready?



pex
17 Apr 2007, 4:59 AM
Hello,

I bet this is a really easy question, but I can't seem to find the answer to this one. I have a div node whose content is dynamically updated using updateManager:



div.getUpdateManager().update({text: 'loading', url:'index.php'});


The result is that the div gets populated with a Form (so the index.php returns pure HTML).

Now when this HTML is loaded I want to add listeners to some of these elements in the returned HTML.
So I tried with div.getUpdateManager().on('update') but when I do console.log(Ext.get('element')); I get an error that this element could not be found.

In other words the event listener doesn't do what it says it should do, or am I using the wrong event listener?

Animal
17 Apr 2007, 5:07 AM
use scripts:true, and that forces the Element.update to wait until the content is loaded before continuing the processing. That will allow you to perform your operations in the callback.

Animal
17 Apr 2007, 5:09 AM
IMHO, this should be fixed in Ext. If there are listeners attached to the "update" event, then Element.update should also wait for content rendering before continuing.

That's a decision for Jack though.

pex
17 Apr 2007, 5:14 AM
Hello Animal,

Thank you for your response, it worked