PDA

View Full Version : rendering to panel body by DOM id



nwatkins
1 Jul 2008, 8:21 AM
I have some third-party javascript library that writes a flash object to a given element. After the panel is loaded I want to display the flash object. Is this the best method:

----

I have a basic extended Ext.Panel with several sub-panels.
For a given sub-panel, say, this.SubPanel I am interested in the DOM Id of its body:

this.SubPanel.body.id

However, I having troubles determining exactly when the body property is available. This property is reported to be undefined in the afterRender, onRender, and show events.

Thanks,
Noah

evant
1 Jul 2008, 1:28 PM
It should be available in onRender:



MyClass = Ext.extend(Ext.Panel,
{
onRender: function(ct, position)
{
MyClass.superclass.onRender.call(this, ct, position);
alert(this.body);
}
}
);

Animal
1 Jul 2008, 11:56 PM
If you want to use media in a Panel, I'd advise using this: http://extjs.com/forum/showthread.php?t=23983