Это похоже на ошибку в Ext 4.0.2a.Когда для свойства matchFieldWidth установлено значение false, раскрывающийся список не имеет размера вообще.
см. Picker.js # alignPicker:
if (me.matchFieldWidth) {
// Auto the height (it will be constrained by min and max width) unless there are no records to display.
picker.setSize(me.bodyEl.getWidth(),
picker.store && picker.store.getCount() ? null : 0);
}
// note: there is no other occurence of setSize in this method
, если для matchFieldWidth указано значение false, picker.setSize
никогда не вызывается и сборщик (= выпадающий список) никогда не захватывается.
Возможным решением является вызов setSize
в любом случае, и только не применять ширину, если matchFieldWidth=true
.
picker.setSize(me.matchFieldWidth ? me.bodyEl.getWidth() : null,
picker.store && picker.store.getCount() ? null : 0);
Примечание: setSize()
будет применять настроенную maxWidth или,maxHeight, если переданное значение равно 'null'.
Возможно, лучше применить патч без изменения источника Ext.
Ext.require('Ext.form.field.Picker', function() {
var Picker = Ext.form.field.Picker;
Picker.prototype.alignPicker = Ext.Function.createSequence(
Picker.prototype.alignPicker, function(width, height) {
if(this.isExpanded && !this.matchFieldWidth) {
var picker = this.getPicker();
picker.setSize(null, picker.store &&
picker.store.getCount() ? null : 0);
}
})
});