我之前在这里问过这个问题,但可能是因为缺乏理解,没有人回答正确。我正在尝试在父容器的mouseenter事件上有一个toolbar (或者你想推荐的其他东西)。
现在,在调整具有flex: 1的container2组件的大小时,toolbar在父容器的底部可见。


下面是我的代码:
var hContainer = []; //adding many blocks to this dynamically
hContainer.push({
xtype: 'panel',
flex:1,
layout: {type:'vbox',align:'stretch'},
items:[{
xtype: 'container',
height: 10,
html: 'hello'
},
{
xtype: 'container',
flex: 1
}]
}) 然后在父容器的mouseenter事件上。panel添加了下面的变量,类似于这个parentContainer.add(upperController)。
var upperController = {
xtype: 'toolbar',
defaultAlign: 'tl', //no effect at all
items: ['->',{
xtype: 'button',
text: '+'
}]
}发布于 2013-03-26 15:39:33
如果是我,我会这样做:容器1和容器2让flex: 1和flex: 2来确定它们的高度。
让Container1表现得像一个容器,并设置一个额外的layout: 'vbox',这样由于父容器上的flex: 1,容器1的高度将保持不变。
然后,您可以在不更改其高度的情况下将项添加到容器1,因为这些子项(项)的flex将决定这些子项(项)的高度。
https://stackoverflow.com/questions/15631625
复制相似问题