Ext面板没有按大小调整展开

Ext Panel not resizing on accordian expand

本文关键字:调整 Ext      更新时间:2023-09-26

我有一个包含多个(max。10)属性网格。

当有几个属性网格项目并且在面板中有空间扩展它们时,这工作得很好。然而,如果面板充满了折叠的网格,那么它们就无法展开。手动增加面板的高度可以使它们展开。

autoScroll已启用。如果我将autoHeight设置为true,则面板大小将适合所有折叠的项目,但不会调整大小以扩展一个项目。

希望有人能告诉我我做错了什么。

由于与GeoExt的兼容性,我正在使用Ext 3.4.0。

感谢汤姆

显示两个属性网格正确扩展的示例http://s9.postimg.org/ex4e6nxwv/working.jpg)示例显示10个不会展开的属性网格http://s13.postimg.org/r06ylu2h3/not.jpg

创建面板和propertygrids代码:

items.push({
  xtype: "propertygrid",
  title: title,
  source: feature.attributes,
  sorting: false
});
if (items.length > 0) {
  new GeoExt.Popup({
    title: "Feature Info - (" + items.length + " Results)" + maxFeatures,
    width: 400,
    height: 300,
    layout: "accordion",
    autoScroll: true,
    map: Map,
    location: evt.xy,
    items: items
  }).show();
}

我不确定是否有一种方法可以让它做你想做的事情,因为它没有消除高度参数,这显然意味着它会更高。

如果你想保持这个高度,你可以把它放到另一个面板中:

var expandos = Ext.create('Ext.panel.Panel', {
    width: 300,
    title: 'Accordion with ' + grids.length + ' panels',
    layout: 'accordion',
    resizable: true,
    items: grids
});
Ext.create('Ext.panel.Panel', {
    renderTo: 'center_div',
    height:400,
    width:315,
    autoScroll: true,
    items:expandos
});
http://jsfiddle.net/SFMpd/2/