私はext4を使用しています。ストア内のデータを使用して、4 つのコンボ ボックスに個別の値を設定する必要があります。しかし、ストアでcollectメソッドを使用すると、空の配列が得られます。ストアに静的データがある場合は機能しますが、ストアでプロキシを使用してデータを取得すると機能しません。
/* inside view */
initComponent: function() {
console.log('inside menu Panel ');
var me = this;
var filterCriteriaStore = Ext.create('ITChart.store.StoreForMenu');
Ext.applyIf(me, {
defaults:{
margin:'20 40 20 20'
},
items: [
{
xtype: 'combo',
id: 'territory',
store: filterCriteriaStore.collect('territory'),
displayField: 'territory',
valueField:'territory',
maxWidth:'100',
margin: '20 40 20 0',
value: 'ABC'
},
{
xtype: 'combo',
id: 'content',
store: filterCriteriaStore.collect('content'),
displayField: 'content',
valueField:'content',
maxWidth:'100',
value: 'XYZ'
}
]
});
me.callParent(arguments);
}
/* not working */
/* inside store */
proxy: {
type: 'ajax',
url : 'http://localhost:8080/ServiceName/getFilterCriteriaExt',
reader: {
type: 'json',
root: 'responseDTO'
}/*,
headers: {
'Content-Type': 'application/json; charset=utf-8; Cache-Control: no-cache'
}*/
//actionMethods: 'POST'
},
/* working */
/* inside store */
data : [
{"content":"XYZ","type":"Song","territory":"ABC","payment":"Paid","errorCode":""},{"content":"Music","type":"Album","territory":"ABC","payment":"Paid","errorCode":""},{"content":"XYZ","type":"Song","territory":"IND","payment":"Paid","errorCode":""},
{"content":"Music","type":"Album","territory":"ABC","payment":"Paid","errorCode":""},
{"content":"Movie","type":"Song","territory":"CHINA","payment":"NotPaid","errorCode":""},
{"content":"Music","type":"Song","territory":"IND","payment":"NotPaid","errorCode":""}
]