私はのようなコンボを持っています
items: {
xtype: 'combo',
id: 'combo',
queryMode: 'local',
displayField: 'name',
valueField: 'id',
store: Ext.create('Ext.data.Store', {
fields: ['id', 'name', 'mydata'],
data: [
{'id': '1', 'name': 'John Smith', 'mydata': ["3", "4"]},
{'id': '2', 'name': 'Albert Einstein', 'mydata': ["1", "2"]}
]
}),
listeners: {
select: function( combo, records, eOpts ) {
alert(records[0].get('mydata')); // records is undefined
}
}
}
しかし、私が使用するとき
var combo = Ext.getCmp('combo');
//combo.select("1");
combo.setValue("1");
combo.fireEvent('select');
その後、alert(records[0].get('mydata')); // records is undefined
失敗します。この問題を解決する方法ありがとう。
ここに私のコードがありますhttp://jsfiddle.net/LZ8XU/