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的值为什么总是获取到第一值
}
}
});
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的值为什么总是获取到第一值
}
}
});
解决方案 »
- 求在网页上把图片隐藏鼠标点过去再显示
- 急!jQuery拖拽中的问题:怎么对有相同id的div绑定拖拽?
- 非表单提交数据修改,不成功,请帮忙修改代码!
- 梅花雪大侠向您求教日历控件的问题
- 我想在单击button时,可以改变gridview中的一列的值,使之从1变为2,请问怎么做呢
- ExtJs4 MVC模式 Store中设置Proxy后正常发出请求,返回数据,但是Store中数据无法获取
- 高分求解决方法,最好是能直接在js里实现的
- 如何用javascript实现:将客户输入参数保存到文件中?
- 请问以下这些属性是什么意思?
- js检测自动中英文字数累加
- 这段JS代码什么意思
- 急 在线等待,js问题 高手请进!
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的值为什么总是获取到第一值
}
}
});
COMBOX在失去焦点时会改变一次值,你可以监听change事件!