我的js:
Ext.onReady(function(){
var dbConnectionRecord = Ext.data.Record.create([
{name: 'dbConnectionKey',type:"string",mapping:"dbConnectionKey"},
{name: 'name',type:"string",mapping:"name"}
]);
var dataProxy=new Ext.data.HttpProxy({url:"<%=basePath%>getDBConnection.action"});
var theReader=new Ext.data.JsonReader({totalProperty: 'totalProperty',root:'root',id:"ecname"},dbConnectionRecord);
var dbstore=new Ext.data.Store({proxy:dataProxy,reader:theReader});
dbstore.load();
var dbcombo = new Ext.form.ComboBox({
id:'dbCombo',
renderTo:Ext.getBody(),
store: dbstore,
valueField:'dbConnectionKey',
displayField:'name',
typeAhead: true,
emptyText:'请选择',
readOnly : true,
mode: 'local',
name:"dbkey",
hiddenName:'dbkey',
editable: false,
triggerAction: 'all',
selectOnFocus:true
});
dbcombo.setValue("4");
});
这样设置后 dbcombo 显示的是 4 而不是 对应的 选项 请各位 给看看怎么回事?