我有一個組合的形式,我試圖找出一個簡單的方法將組合值傳遞給組合小部件。試圖通過initComponent傳遞參數到項目數組
基本上我穿過陣列到我的形式,如下所示:
var contentPanel = Ext.create('MyForm', {
countryCodesForCombo: _this.countryCodesForCombo,
});
這意味着數據來自通過initComponent方法。
Ext.define('MyForm', {
extend: 'Ext.form.Panel',
initComponent : function(){
var cCodes = this.countryCodesForCombo;
this.callParent();
},
items: [
{
fieldLabel: 'Hi',
xtype: 'combobox',
name: 'land',
displayField:'name',
store: {
fields: ['name'],
data: this.countryCodesForCombo // <--- want to get country codes somehow here
}
}
]
});
但是,這些值不能到達項目對象。
基本上我的問題是,如何通過initComponent方法將值傳遞給items數組?
想想評價的順序。對象的整個RHS需要在它被定義之前進行評估。該類不存在,更不用說實例了。 – 2014-09-04 09:26:14