[CLOSED] Content Update problem
I have the following code as part of a border layout in my main.aspx file :
Code:
<Center>
<ext:Panel ID="Panel7" runat="server">
<Content>
<div class="content">
<h1>Welcme</h1>
<p>Please use the navigation on the left to browse the site</p>
<p>If you need any help please contact us</p>
</Content>
</ext:Panel>
</Center>
I want to change/update the content the content div from my custom Javascript.
Code:
<div class="content">
I am doing :
Code:
var a = Ext.getCmp('Panel7').body.dom;
a.innerHTML = '<div class="content"> + somecontent + '
';
Ext.getCmp('Panel1').doLayout();
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
Code:
.firstChild.getElementsByCLassName('content')[0]
But it doesn't work in IE 7. Please help. Thanks
RE: [CLOSED] Content Update problem
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.
Example
Code:
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.
Example
Code:
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...2938-12-1.aspx
</A>Hope this helps.
RE: [CLOSED] Content Update problem
Sorry for a late reply Geoffery and thanks you.