更新时间:2023-12-04 12:26:04
以下是一些在应用程序中定位组件的提示。 / p>
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/core/manual/content/domquery.html
(more on DOM Query http://docs.sencha.com/core/manual/content/domquery.html