Combobox 默认显示 list和edit 一样宽。 如何让下拉列表更宽些呢? 可以使用expand event.
comboPurchaseOrder = new Ext.form.ComboBox({
//cls: 'x-mycombo-list',
tpl: resultTpl,
store: PurchaseOrderStore,
displayField: 'PurchaseOrder',
valueField: 'PrimaryKey',
typeAhead: false,
mode: 'local',
triggerAction: 'all',
selectOnFocus: true,
value: '',
width: 120,
itemSelector: 'div.search-item',
applyTo: 'ddlPurchaseOrder'
});
comboPurchaseOrder.on('expand', function(comboBox) {
comboBox.list.setWidth('240px'); //auto
comboBox.innerList.setWidth('auto');
}, this, { single: true });
简单实用,try it.