View Full Version : [CLOSED] Content Update problem

Oct 27, 2008, 1:31 PM
I have the following code as part of a border layout in my main.aspx file :


<ext:Panel ID="Panel7" runat="server">


<div class="content">


<p>Please use the navigation on the left to browse the site</p>

<p>If you need any help please contact us</p>




I want to change/update the content the content div from my custom Javascript.

<div class="content">

I am doing :

var a = Ext.getCmp('Panel7').body.dom;
a.innerHTML = '<div class="content"> + somecontent + '

I want to avoid having to put the wrapper div everytime. Is there a way I can just change what is inside the div. I used the


But it doesn't work in IE 7. Please help. Thanks

Oct 27, 2008, 6:58 PM
Hi sz_146,

If you're are adding html inside the <Content> tags a with a unique ID is automatically created. It might be easiest to just use that and not add another <div class="content"> wrapper.

To get an instance of the <Content> , append the string "_Content" to .ClientID of the Panel.

Once you have an instance of a , use the .update() function to set the innerHTML.

The following code sample demonstrates how to get an instance of the default body and update the content.


Ext.get('Panel1_Content').update('some content here');

With the release of v0.7 we have changed the <Content> tag to <Body> and the above code can be simplified using the following code sample.


Panel1.getBody().update('some content here');

More information re: the switch to <Body> can be found at <A href="http://forums.ext.net/showthread.php?threadid=2938-12-1.aspxHope">http://forums.ext.net/showthread.php?threadid=2938-12-1.aspx

</A>Hope this helps.

Oct 29, 2008, 6:55 AM
Sorry for a late reply Geoffery and thanks you.