ExtJS的下拉选单Combobox中空选项的高度问题
ExtJS的下拉选单组件Combobox如果有空选项时,会有空选项高度太小的问题,如下图:
解决方法是为Combobox的tpl属性设置template string,并在该template string中添加高度样式定义,例如:
new Ext.form.ComboBox({name: 'gender',triggerAction: 'all',editable: false,disabled:false,mode: 'local',displayField: 'name',valueField: 'value',store:genderStore,tpl:'<tpl for=".">' + '<div style="height:12px;">' + '{name}' +'</div>'+ '</tpl>'})
tpl:'<tpl for=".">' +'<div >' + '{name} ' +'</div>'+ '</tpl>'.x-combo-list-item { height: 21px;}