更新时间:2023-12-04 12:30:58
这里有一些关于在应用中定位组件的提示.
Here are some tips on targeting a component in an app.
首先要非常小心地在组件上使用 ID.我已经看到我与他们分享的问题.不惜一切代价避免.
其次,ExtJS 提供了多种定位方式组件 和 元素.不要将两者混为一谈.
Second, ExtJS provides several ways of targeting Components and Elements. Don't mix the two.
For Components:
• Ext.getCmp(id)
• Ext.ComponentQuery.query()
• up()
• down()
• nextSibling()
• previousSibling()
• child()
• previousNode()
plus various find.. Methods
For Elements:
• Ext.get()
• Ext.dom.Query()
(更多关于 DOM 查询 http://docs.sencha.com/核心/手册/内容/domquery.html
(more on DOM Query http://docs.sencha.com/core/manual/content/domquery.html