1

我有一个包含两个文本字段项的复合字段。第一个文本字段的增长属性设置为 true。当第一个文本字段的宽度自动调整大小时,它会与右侧的字段重叠。我希望后续项目随着前面字段的增长而向右调整/移动它的位置。例如

  new Ext.form.CompositeField({
       autoHeight: true
       , autoWidth: true
       , items:[{
           xtype:'textfield'
           , flex: 1
           , growMax: 125
           , growMin: 80
           , width: 80
           , grow: true
           , listeners: {
               'autoSize': function () { 
               // what should I do here??  i tried accessing the 
               // ownerCt syncSize() but didn't work
            }            
        }}
        , {
           xtype:'textfield'
           , flex: 1
           , width: 80
        }]
     });

先感谢您。

4

1 回答 1

2

这似乎是 extjs 的错误。但是,我找到了解决方法:

    'autoSize': function () { 
           if (this.width == this.el.dom.offsetWidth)
               return;
           this.width = this.el.dom.offsetWidth;
           this.ownerCt.doLayout();
        }

这是小提琴

于 2011-07-21T06:10:38.563 回答