[英]Using collapsible with extjs4
我正在嘗試使ExtJS4中的面板之一可折疊。 當我使用“ collapsible:true”時,運行我的應用程序時面板是可折疊的。 但是,如果我折疊面板,它就會消失,所以我無法對其進行折疊。
我不確定需要圍繞面板還是直接在面板上方。 我嘗試使用示例代碼:
{
region: 'north',
collapsible: false,
title: 'North',
split: true,
height: 100,
minHeight: 60,
html: 'north'
},
當我將其添加到網頁頂部的視口中時,該方法就起作用了。 但是,當我將其放置在頁面上我想要的位置時,我可以將其折疊,但隨后消失。 誰能讓我知道折疊后會消失的原因是什么?
擴展Geronimo的答案,有時僅在面板本身上設置布局是不夠的。 在這種情況下,請嘗試將您的面板包裝成另一塊fit
布局的面板。 代替
{
xtype: 'mypanel',
title: 'my little panel',
collapsible: true,
...
}
做這個:
{
xtype: 'panel',
title: 'my little panel', // Pull certain configs up to the wrapper panel,
collapsible: true, // like title and collapsible
layout: 'fit',
items: [
{
xtype: 'mypanel',
title: undefined, // Make sure there is not another title bar
border: false, // We don't want another border
...
}
]
}
不好,但到目前為止,我找不到更好的解決方案,它對我來說已經在兩種不同的情況下起作用了。
我有一個類似的問題,解決它基於關閉的這個 。 基本上,請確保您在遇到麻煩的面板上指定了正確的布局配置,例如layout: 'fit'
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.