2
我有一個數據添加到組合框的一個問題連擊(這是我的代碼:添加數據ExtJS的
{
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
}
我如何添加店連擊 感謝
我回答了我的請求: {「success」:true,「message」:null,「list」:null,「data」:[{「name_y」:「???」,「nzp_res」: 18, 「nzp_y」:1},{ 「name_y」: 「???」, 「nzp_res」:18, 「nzp_y」:2},{ 「name_y」: 「???」, 「nzp_res」:18, 「nzp_y」:3},{ 「name_y」: 「???」, 「nzp_res」:9999, 「nzp_y」:1},{ 「name_y」: 「???」, 「nzp_res」:9999,「nzp_y 「:2」,{「name_y」:「???」,「nzp_res」:9999,「nzp_y」:3}]} 我試過你的建議,但它給了我錯誤(reader.read不是 函數)在這一行中: result = reader.read(me.extractResponseData(response)); – Oleg