Ext ComboBox初始化

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
});
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章