jgemedina
jgemedina

Reputation: 526

ExtJS: Clear panel content before loading

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?

Upvotes: 3

Views: 14564

Answers (2)

Ext.getCmp('xxxxxxxxxxx').getStore().removeAll();

WHERE XXXXXXXXX IS YOUR STORE.

Upvotes: 0

Chau
Chau

Reputation: 5570

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?

Upvotes: 13

Related Questions