Extjs 手风琴布局

发布于 2024-10-10 02:24:47 字数 66 浏览 4 评论 0原文

手风琴布局是堆叠面板布局,一次只有一个面板可见,但我想同时显示两个可见面板,所以我们可以使用手风琴面板来做到这一点吗?

Accordion Layout is stacked panel layout in that only one panel is visible at time but i wanted to show two panel visible at time so can we do this with accordion panel??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦太阳 2024-10-17 02:24:47

您无法扩展现有的 Accordion Layout 类来实现您想要的效果。如果您查看源代码,您会注意到 Accordion 布局是通过扩展 FitLayout 创建的。现在,我引用文档中解释的 FitLayout 属性:

这是布局的基类,
包含一个项目
自动扩展以填充
布局的容器。

该文档进一步指出:

如果容器有多个面板,
仅显示第一个。

现在,提问者要求的是同时显示两个面板。对于从 FitLayout 扩展的任何布局来说,这是根本不可能的。

其他问题

提问者计划实现的组件存在一些设计问题;

  1. 当前显示的面板将占用多少空间?
  2. 手风琴行为将如何运作?当用户尝试访问第三个面板时..当前打开的面板的行为如何。

可能的解决方案:

现在,一种可能的解决方案是使用 vbox 布局扩展一个面板并将所有面板包含在其中。

You cannot extend the existing Accordion Layout class to achieve what you are looking for. If you go through the source code, you will notice that the Accordion layout is created by extending FitLayout. Now, I quote the property of FitLayout explained in documentation:

This is a base class for layouts that
contain a single item that
automatically expands to fill the
layout's container.

The documentation further says:

If the container has multiple panels,
only the first one will be displayed.

Now, what the questioner is asking for is to display two panels at the same time. Which is simply not possible with any layout extending from FitLayout.

Other Issues:

There are some design issues with the component the questioner is planning to implement;

  1. What about of space will the currently displayed panels take?
  2. How the accordion behavior will work? When user try to access the third panel.. how does the currently open panels behave.

Possible Solution:

Now, one possible solution is to the extend a Panel with vbox layout and have all the panels in it.

逆夏时光 2024-10-17 02:24:47

在 Ext js 4.1 中可以通过使用 Accordion 布局的 multi 属性来实现。

检查 文档< /a> 这里..

It is possible in Ext js 4.1 by using multi property of Accordion layout.

Check the docs here..

白首有我共你 2024-10-17 02:24:47

我确信您无法使用现有的 AccordionLayout 来做到这一点。

您可以编写自己的布局类来做到这一点。这并不难,AccordionLayout.js 只有几页长,大部分都是注释。

I'm sure you can't do it with the existing AccordionLayout.

You could write your own layout class to do it. It's not that hard, the AccordionLayout.js is only few pages long and most of it are comments.

安稳善良 2024-10-17 02:24:47

手风琴布局不是为此设计的。根据您的要求选择布局就像尝试将球体放入矩形中一样。

然而,如果你用枪指着我的头,我很快就会想到以下选择。

  1. 扩展现有的 Accordion 类(丢弃。因为基础不是为此设计的
  2. 编写您自己的神奇 Accordion(除了实现之外,您还必须回答 Abdel Olakara 提到的问题,您自己
  3. 通过堆叠两个或多个手风琴来模仿所需的行为(好吧,这不是一个好主意,但枪在我头上)。

Accordion layout is not designed for that. Choosing according layout for your requirement is like trying to fit sphere in a rectangle.

However, if you put a gun on my head, I quickly think about following options.

  1. Extend existing Accordion class (Discard. Since base is not design for that)
  2. Write your own magic Accordion (Apart from implementation, you have to answer Abdel Olakara mentioned issues, your self)
  3. Mimic the desired behavior, by stacking up two or more Accordions (Well, not a great idea, but gun is on my head).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文