From 76c235e30d9b60a30fcc6ef548ccb887661a7f10 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 14 Sep 2010 23:56:30 +0800 Subject: [PATCH] widgets/ComboBoxLister.js --- widgets/ComboBoxLister.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/widgets/ComboBoxLister.js b/widgets/ComboBoxLister.js index c631dc08..a9524723 100644 --- a/widgets/ComboBoxLister.js +++ b/widgets/ComboBoxLister.js @@ -80,6 +80,33 @@ Ext.extend(Ext.form.ComboBoxLister, Ext.form.ComboBox, { //this.adder.on('click', this.onAddClick, _t); }, + + + onResize: function(w, h){ + Roo.form.ComboBox.superclass.onResize.apply(this, arguments); + + if(typeof w != 'number'){ + // we do not handle it!?!? + return; + } + var tw = this.trigger.getWidth(); + tw += this.addicon ? this.addicon.getWidth() : 0; + tw += this.editicon ? this.editicon.getWidth() : 0; + var x = w - tw; + this.el.setWidth( this.adjustWidth('input', x)); + + this.trigger.setStyle('left', '0px'); + + if(this.list && this.listWidth === undefined){ + var lw = Math.max(x + this.trigger.getWidth(), this.minListWidth); + this.list.setWidth(lw); + this.innerList.setWidth(lw - this.list.getFrameWidth('lr')); + } + + + + }, + addItem: function(rec) { if (this.items.indexOfKey(rec[this.idField]) > -1) { -- 2.39.2