所有的适应工作都很好(value field被提交了),但是在页面加载后我无法设置组合框的默认值,它们显示为空。 以前,我只需在config中指定'value'参数即可做到这一点。 有什么想法如何解决这个问题吗?
我的代码 - 模型和存储:
Ext.define('idNamePair', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'string'},
{name: 'name', type: 'string'}
]
});
var dirValuesStore = new Ext.data.Store({
model: 'idNamePair',
proxy: {
type: 'ajax',
url: '../filtervalues.json',
reader: {
type: 'json',
root: 'dir'
}
},
autoLoad: true
});
组合配置:
{
triggerAction: 'all',
id: 'dir_id',
fieldLabel: 'Direction',
queryMode: 'local',
editable: false,
xtype: 'combo',
store : dirValuesStore,
displayField:'name',
valueField:'id',
value: 'all',
width: 250,
forceSelection:true
}