我通过扩展 Ext.container.Container
创建了一个自定义 ExtJS由类似 radiofield
的控件组成, combo
和一个 dataview
并将其命名为alias
配置为widget.CustomerDetail
.
在实际 View 中,我通过在 items
中定义它来使用此组件。数组如下。
{
xtype: 'CustomerDetail',
itemId: 'customerDetail',
customerId: '<some id>', //this is custom attribute that I access in CustomerDetail's constructor.
listeners: {
'customerDataChanged': function(sender, eOpts) {
//This event is fired from CustomerDetail's components' change events
//by this.fireEvent("customerDataChanged", obj, eOpts);
//Do something like enabling Parent form's Save button.
}
}
}
但是我无法使用 this.getComponent('<parent_form_itemId').getComponent('customerDetail')
在其父 View (使用它的表单)中查询此自定义组件。 .
同时,如果我只是检查 this.getComponent('<parent_form_itemId')
,它具有完整的表单对象,其 items
数组还有CustomerDetail
组件,但令人惊讶CustomerDetail
s 对象没有 xtype
或itemId
存在于其中。
这里出了什么问题?
最佳答案
关于javascript - 自定义 ExtJS 组件中缺少 xtype 和 itemId 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16706837/