如何替换ExtJS中的组件 [英] How to replace a component in ExtJS

查看:159
本文介绍了如何替换ExtJS中的组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ExtJS窗口,顶部有一个工具栏,并使用纯HTML加载底层的普通面板。这工作正常点击一下按钮,我想用另一个面板替换底部面板(称为内容)。如果尝试这个

  var clickHandler = function(calendar){
//'content'是面板id
//日历也是一个Ext.Panel对象
Ext.getCmp('content')。update(calendar);
};

我缺少什么?

解决方案

更新替换HTML内容。



您要删除旧面板并添加新的面板。尝试.remove()旧的面板和.add()新的,并不要忘记.doLayout()。


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 replace 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().

这篇关于如何替换ExtJS中的组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆