我試圖創建JSON店,這是該格式的多選列表ExtJS的從JSON字符串列表多選
[{"photo_id":1,"file_name":"test.JPG","x":123,"y":456},{"photo_id":2,"file_name":"test2.JPG","x":321,"y":765}]
多選列表填充行,但它並沒有顯示在列表中的FILE_NAME
var storeVar = new Ext.data.Store({
extend: 'Ext.data.Model',
fields: ['photo_id', 'file_name'],
data: store // contains the json string
});
,這裏是多選箱
Ext.create('Ext.form.Panel', {
bodyPadding: 10,
frame: true,
width: '100%',
items: [
{
anchor: '100%',
displayField: 'file_name',
valueField: 'photo_id',
store: storeVar ,
xtype: 'multiselect',
fieldLabel: 'Select an image',
allowBlank: false
}
]
})
很抱歉,但你可以再次編輯您的文章,因爲你給了一個無效的JSON數據,'{...「Y」:456,{「photo_id ...}' –
ok了,是我不好,讓我編輯現在 – Grigor