ExtJS - 如何获取组件的DOM ID? [英] ExtJS - How to get DOM ID of a component?
本文介绍了ExtJS - 如何获取组件的DOM ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
提前谢谢!
-Jack
解决方案
我相信这是你需要的: http://docs.sencha.com/extjs/4.2.2/#! /api/Ext.Component-method-getEl
示例:
//获取Dom元素
var DomEl = Ext.getCmp('ComponentID')。getEl();
// get Id
var DomElId = DomEl.id;
Say the component doesnt have an ID given to it. So how would you first, get a handle on the component, and then get the DOM Id of that component?
thanks in advance!
-Jack
解决方案
I believe this is what you need: http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.Component-method-getEl
Example:
//get Dom Element
var DomEl = Ext.getCmp('ComponentID').getEl();
//get Id
var DomElId = DomEl.id;
这篇关于ExtJS - 如何获取组件的DOM ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文