Extjs combobox 加载不进去数据

2024-12-10 22:48:03
推荐回答(2个)
回答(1):

var store= Ext.create('Ext.data.Store', {
fields: ['id', 'name']
proxy: {
type: 'ajax',
url: 'your url',
reader: {type: 'json'}
}
});

{
xtype: 'combo',
store: store,
fieldLabel: '建成年份',
displayField: 'name',
valueField: 'id'
}

//你试试看这样行不行,因为extjs版本的不同,同样的写法可能会不起作用,我这里用的是4.0

回答(2):

json返回格式对吗?需要root吧