如何使用ExtJS显示/隐藏/切换元素? [英] How to Show/Hide/Toggle Element with ExtJS?

查看:96
本文介绍了如何使用ExtJS显示/隐藏/切换元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何用ExtJS显示/隐藏/切换元素

How to Show/Hide/Toggle Element with ExtJS?

推荐答案

非常简单,在元素级(进一步到

Very straightforward, at the element level (further to the comments below):

Ext.get("my-div");

其中 my-div

请参阅这里此处

在组件级别:

Ext.getCmp('idofthecomponent').getEl().show();
Ext.getCmp('idofthecomponent').getEl().hide();
Ext.getCmp('idofthecomponent').getEl().toggle();

请参阅(显示)这里(隐藏)这里(切换)。所以'idoftheComponent'将会被分配给一个Panel对象的id。

See here (show), here (hide) and here (toggle) respectively. So 'idofthecomponent' would be, say the id assigned to a Panel object.

您还可以直接使用其他选择器来引用该元素,例如document.getElementbyId ,例如

You can also refer to the element directly using other selectors, such as document.getElementbyId, eg.

 document.getElementById('elementtoshow').show();

这篇关于如何使用ExtJS显示/隐藏/切换元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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