如何使用 ExtJS 显示/隐藏/切换元素?
最佳答案
非常简单,在元素级别(进一步到下面的评论):
Ext.get("my-div");
哪里
my-div
是相关元素的 id。见 here和 here
在组件级别:
Ext.getCmp('idofthecomponent').getEl().show();
Ext.getCmp('idofthecomponent').getEl().hide();
Ext.getCmp('idofthecomponent').getEl().toggle();
见 here (show) , here (hide)和 here (toggle)分别。所以 'idofthecomponent' 就是分配给 Panel 对象的 id。
您也可以使用其他选择器直接引用该元素,例如 document.getElementbyId ,例如。
document.getElementById('elementtoshow').show();
关于extjs - 如何使用 ExtJS 显示/隐藏/切换元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4074673/