【发布时间】:2011-04-15 22:50:22
【问题描述】:
在我的 extjs 选项卡面板中,我有一个选项卡。在标签中我做了一个:
this.tab.add(this.someGrid1);
现在基于某个条件,我想做:
if (cond ==true)
this.tab.remove(this.someGrid1);
this.tab.add(this.someGrid2);
这可能吗? 我试过没有删除,但它不起作用。什么都没有发生,旧的 someGrid1 仍然存在。
编辑:根据建议,我将代码更改为:
if (cond ==true)
this.tab.remove(this.someGrid1);
this.tab.add(this.someGrid2);
this.tab.doLayout();
else if (cond ==false)
this.tab.remove(this.someGrid2);
this.tab.add(this.someGrid1);
this.tab.doLayout();
当页面加载时,cond == true 一切正常。当我通过组合将 cond 更改为 false 时, someGrid1 加载正常。
当我改回cond ==true时,代码不会执行超出
this.tab.add(this.someGrid2);
this.tab.doLayout();
并且 someGrid2 未呈现。错误是这样的:
Error: b.getPositionEl().dom is undefined
【问题讨论】:
标签: extjs