tags:

views:

170

answers:

1

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
No, it inserts the new content above the current content, i've got two panels inside it
jgemedina
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
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
@jgemedina: Try posting a working example - this will challenge us to locate and maybe even solve the problem :)
Chau
here's the container panel and its initial components, when loading from javascript with component.load({}) the initial content remailshttp://pastebin.com/Vb14mKZD
jgemedina
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