简体   繁体   English

边框布局代码损坏,看不到内容

[英]border layout code breaking, not able to see the content

  • I have hbox layout, where in the left it shows tree and on the right it shows tabs. 我有hbox布局,在左侧显示树,在右侧显示选项卡。
  • But the problem is I should not use hbox, but I should use border layout. 但是问题是我不应该使用hbox,而应该使用边框布局。
  • When I use two column layout code is breaking. 当我使用两列布局代码时会中断。
  • Providing my code with hbox layout. 为我的代码提供hbox布局。
  • Can you guys tell me how to make the below code work in border layout. 你们能告诉我如何使以下代码在边框布局中工作吗?

https://docs.sencha.com/extjs/4.1.3/#!/api/Ext.layout.container.Border https://docs.sencha.com/extjs/4.1.3/#!/api/Ext.layout.container.Border

I am trying to change border in the below part of code 我正在尝试在代码的以下部分更改边框

var createTreeAndContentPanel = function(tree) {
        var retval,
            contentPanel;

According to docs, if you are using a "Border" layout, at least one of the child panel has to use region : "center". 根据文档,如果您使用的是“边框”布局,则至少一个子面板必须使用region:“ center”。 So you need to apply region : center on your panel containing tabs, and region : west to your panel containing tree. 因此,您需要在包含标签的面板上应用region : center在包含树的面板上应用region : west

在此处输入图片说明

Finally you need to add these 2 panels inside a parent panel with a layout: border 最后,您需要将这2个面板添加到具有以下layout: border的父面板中layout: border

From doc : 从文档:

Any Container using the Border layout must have a child item with region:'center'. 任何使用“边框”布局的“容器”都必须有一个子项,其区域为“ center”。 The child item in the center region will always be resized to fill the remaining space not used by the other regions in the layout. 中心区域中的子项将始终调整大小以填充布局中其他区域未使用的剩余空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM