Extjs 手风琴布局
手风琴布局是堆叠面板布局,一次只有一个面板可见,但我想同时显示两个可见面板,所以我们可以使用手风琴面板来做到这一点吗?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您无法扩展现有的 Accordion Layout 类来实现您想要的效果。如果您查看源代码,您会注意到 Accordion 布局是通过扩展 FitLayout 创建的。现在,我引用文档中解释的 FitLayout 属性:
该文档进一步指出:
现在,提问者要求的是同时显示两个面板。对于从 FitLayout 扩展的任何布局来说,这是根本不可能的。
其他问题:
提问者计划实现的组件存在一些设计问题;
可能的解决方案:
现在,一种可能的解决方案是使用 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:
The documentation further says:
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;
Possible Solution:
Now, one possible solution is to the extend a Panel with vbox layout and have all the panels in it.
在 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..
我确信您无法使用现有的 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.
手风琴布局不是为此设计的。根据您的要求选择布局就像尝试将球体放入矩形中一样。
然而,如果你用枪指着我的头,我很快就会想到以下选择。
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.