ComboBox初始化第一次加載的時候顯示的是key值,點擊一次之後以後才顯示的是value值,開始是加載的時候給它手工賦值,但提交的時候會提交value值而不是key值
解決方法:
store: new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url:"",
method: "",
headers: {
accept: "application/xml"
}
}),
reader: new Ext.data.XmlReader({
totalRecords: "total",
record: "item"
},[{
name: "key",
name: "value"
}]),
autoLoad: true
});
new Ext.form.ComboBox({
fieldLabel: "測試",
name: "test",
hiddenName: "name",
vlaueField: "key",
dispalyField: "value",
// mode: "remote",
store: store,
typeAhead: true,
forceSelection: true,
triggerAction: "all",
selectOnFocus: true
});