i'm trying to load some content to an existing panel with #{component}.load({url:''}); but the panel has already some content, how do i clear the panel content?
+1
A:
See the panel
method removeAll(...)
.
var panel = new Ext.Panel({
title: 'Panel',
id: 'panel',
layout: 'form',
items:
[
{
xtype: 'textfield',
fieldLabel: 'Text',
value: 'Textfield'
}
]
});
panel.removeAll(true);
Does this work for you?
Chau
2010-09-02 08:50:55
No, it inserts the new content above the current content, i've got two panels inside it
jgemedina
2010-09-02 14:38:03
im actually using Coolite, i'm trying to do this based on what you said#{panelId].removeAll(true); #{panelId}.load(url:'some_other_page.aspx', method:'POST'});inside the Handler attribute of a linkbutotn
jgemedina
2010-09-02 14:39:44
sorry, if an external site is added that happens, if added some other page no content is shown, i'll review the container panel or load method to find the issue, thanks!
jgemedina
2010-09-02 14:47:10
@jgemedina: Try posting a working example - this will challenge us to locate and maybe even solve the problem :)
Chau
2010-09-03 06:31:16
here's the container panel and its initial components, when loading from javascript with component.load({}) the initial content remailshttp://pastebin.com/Vb14mKZD
jgemedina
2010-09-03 17:51:12
I think you should post a *working* example - not just a minor part of the code. Are you sure the `load` part is called *after* the panels has finished loading?
Chau
2010-09-06 06:44:30