开发者

How to replace a component in ExtJS

开发者 https://www.devze.com 2023-02-17 14:11 出处:网络
I have an ExtJS window, with a toolbar at the top, and loads with plain Panel at the bottom with plain HTML. This works fine. On a button click, I\'d like to be able to repla开发者_如何学Cce the botto

I have an ExtJS window, with a toolbar at the top, and loads with plain Panel at the bottom with plain HTML. This works fine. On a button click, I'd like to be able to repla开发者_如何学Cce the bottom panel (called content), with another panel. If tried this

var clickHandler = function(calendar){
    // 'content' is the panel id
    // calendar is also an Ext.Panel object
    Ext.getCmp('content').update(calendar); 
};

What am I missing?


Update replaces HTML content.

You want to remove the old panel and add the new. Try .remove()ing the old panel and .add()ing the new one, and don't forget .doLayout().

0

精彩评论

暂无评论...
验证码 换一张
取 消