EXTJSの複数選択ボックスにエントリを表示できません。EXTJSの複数選択と対応するパネルのコードは次のとおりです。
var selectTrain = [{
bodyStyle: 'padding:10px;',
items:[{
xtype: 'multiselect',
fieldLabel: 'Multiselect',
name: 'multiselect',
width: 250,
height: 200,
id: 'selectTrain',
store: new Ext.data.JsonStore({
type: 'ajax',
url:'http://abc.com/xyz',
reader: 'json',
autoLoad:true
}),
ddReorder: true
}]
}];
// combine all that into one huge form
var fp = new Ext.FormPanel({
title: '',
frame: true,
labelWidth: 300,
width: 800,
renderTo:'report',
bodyStyle: 'padding:0 10px 0;',
items: [
{
layout: 'column',
border: false,
// defaults are applied to all child items unless otherwise specified by child item
defaults: {
columnWidth: '1',
border: false
},
items: [selectTrain]
},
],
buttons: [{
text: 'Go',
handler: function(){}
},{
text: 'Reset',
handler: function(){
fp.getForm().reset();
}
}]
});
サーブレットであるURLhttp: //abc.com/xyzにアクセスすると、Firebugコンソールに次のJSONが書き込まれているのを確認できます。
{"54850":"5.1(1t)d1(3)","54852":"5.1(1t)a2(3)","54853":"5.1(1t)l2(1)","54841":"1.2(4)S1(1)","54789":"5.3(1)T","54849":"5.1(1t)s1(2)","54854":"5.1(1t)l2(5)","54855":"5.1(1t)s2(6)","54847":"1.1(12a)SG"}
http://abc.com/xyzのサーブレットコードは次のとおりです。
PrintWriter out = response.getWriter();
JSONObject jsonObj=new JSONObject();
for (Iterator iterator = allRelInfoPools.iterator(); iterator
.hasNext();) {
Vector v = (Vector) iterator.next();
jsonObj.put((String)v.get(0),(String)v.get(1));
}
out.println(jsonObj);
plsはアドバイスします、私はどこが間違っているのですか?