//先来看combox执行选择的方法
var c = Ext.create('Ext.form.ComboBox', {});
//用这个方法可以选中数据
c.select(Object r);
//你要根据后台显示,只需要从store中抽出要选中的object就行了
Ext.Ajax.request({
url: 'xxx',
success: function (response) {
var data = Ext.decode(response.responseText);
//为他加载数据
c.store.loadData(data , false);
//这里的field应是selectvalue,而不是showvalue
var index = c.store.find('store的field', 0);
if (index != -1) {
c.select(c.store.getAt(index));
}
}
});
xtype : 'combo',
//其他参数略
store : [[0:正常],[1:异常]],
value: 你传过来的值