var storeList = new Ext.form.ComboBox({
                id:'transport',
                    store: ds,
                    fieldLabel: '交通工具',
                    allowBlank: false,
                    forceSelection: true,
                    valueField: id, // option.value
                    typeAhead: true,
                    displayField: 'name', // option.text
                    triggerAction: 'all',
                    emptyText: '请选择...',
                    mode: 'local',
                    selectOnFocus: true,
                    width: 135,
                    listeners:{
"select":function(){
alert(Ext.get("transport").dom.value); //获取id为combo的值为什么总是获取到第一值
}
}   
                });

解决方案 »

  1.   

    var storeList = new Ext.form.ComboBox({
                    id:'transport',
                        store: ds,
                        fieldLabel: '交通工具',
                        allowBlank: false,
                        forceSelection: true,
                        valueField: id,此处没加单引号,与store定义不一致 // option.value
                        typeAhead: true,
                        displayField: 'name', // option.text
                        triggerAction: 'all',
                        emptyText: '请选择...',
                        mode: 'local',
                        selectOnFocus: true,
                        width: 135,
                        listeners:{
    "select":function(){
    alert(Ext.get("transport").dom.value); //获取id为combo的值为什么总是获取到第一值
    }

                    });
      

  2.   

    好像是EXT的一个BUG,郁闷!
    COMBOX在失去焦点时会改变一次值,你可以监听change事件!