PDA

View Full Version : How to access "InnerHTML" of a Panel before first show



zoggo
28 Mar 2012, 10:17 AM
Hi,

I like to render a not Ext JS Component into a panel. For that I need a DIV-Tag. If I add a DIV-Tag with the HTML-Property the DIV-Tag appears after rendering. So, how can I access the inner DIV of a Panel or how can add a DIV before first show of the panel? Is there a Event when the DIV is ready to access with Ext.get("div_id")?



{
xtype: 'panel',
anchor:'100%',
height:200,
html : "<div id='printOverviewMapDiv' style='width: 100%; height: 100%; margin: 0;'></div>",
listeners:{
afterrender : function(){
this.body.dom.innerHTML = <div id='printOverviewMapDiv'></div>;
var map = Ext.get("printOverviewMapDiv");
pPrintOverviewMap = new esri.Map(map {
extent : pMap.extent
});
}
}
}
}

mitchellsimoens
28 Mar 2012, 10:28 AM
You should be able to just have the esri.Map render to the panel's body element. You shouldn't need to insert a <div>

zoggo
28 Mar 2012, 10:49 AM
How do I access the panel's body?

mitchellsimoens
28 Mar 2012, 10:53 AM
How do I access the panel's body?

after render, panel.body