我在向组合框添加数据时遇到问题(这是我的代码:
{
xtype: 'combo',
name: 'accounttype',
triggerAction: 'all',
fieldLabel: '??? ?????',
labelWidth: 125,
displayField: 'name_y',
valueField: 'nzp_y',
width: 280,
emptyText: '??? ?????',
listeners: {
afterrender: function (item) {
Ext.Ajax.request({
url: 'account/combodata',
method: 'POST',
success: function (objServerResponse) {
var jsonResp = Ext.decode(objServerResponse.responseText);
if (jsonResp.success == true) {
var mystore = new Ext.data.JsonStore({
fields: ['nzp_y', 'name_y'],
data: [{ nzp_y: 0, name_y: ' '}]
});
var myArray = new Array();
for (var i = 0; i < jsonResp.combolist.length; i++)
{
if (jsonResp.combolist[i].nzp_res == 9999)
{
myArray['nzp_y'] = jsonResp.combolist[i].nzp_y;
myArray['name_y'] = jsonResp.combolist[i].name_y;
//???
}
}
}
},
failure: function (objServerResponse) {
Ext.Msg.alert('Error', objServerResponse.responseText);
}
});
}
},
store: mystore
}
如何将商店添加到组合?谢谢。