PDA

View Full Version : Updating a panel's div dynamically after render



Boss
15 Dec 2010, 2:41 PM
Am trying to create some div's and update an Ext panel with those div's. What is the best way to obtain the panel after rendering.

I registered 'this.on('afterrender', this.updatePanel);' in my component.

However in my updatePanel()
Ext.get('id') does not give me the element .
cmp = Ext.getComponent('id') works but getting the element from 'cmp' by doing cmp.getEl() gives me null.

How do I get my panel after its rendered and which event should I use. Thanks in advance

Animal
16 Dec 2010, 12:50 AM
http://dev.sencha.com/deploy/dev/docs/?class=Ext.Panel&member=body

But throwing dead, textual HTML around has no future.

Add Components to a Panel, tell the Panel what layout to use to arrange them, and off you go.

Boss
16 Dec 2010, 8:18 AM
Thanks. So should I put in panels again in place of div's within my Panel ? Won't this take more rendering time if I need to put 100 child panels (each one representing a thumbnail ) inside my main panel ? Or will it be the same since panel internally uses divs.

Animal
16 Dec 2010, 8:24 AM
Thumbnails?

Use a DataView.

As shown in the example ni your SDK.

Boss
16 Dec 2010, 9:58 AM
Yeah, I see that. Thanks a lot !