javascript - Extjs 中的容器与面板

标签 javascript html css extjs

我有一个关于 Extjs 的问题

我已经阅读了关于 Sencha doc 的官方文档,但我对两种 Component 感到有些困惑。即 Container 和 Panel。

容器和面板有什么区别?在什么情况下应该使用哪个?

非常感谢任何回答。

最佳答案

摘自 documentation of Container :

Base class for any Ext.Component that may contain other Components. Containers handle the basic behavior of containing items, namely adding, inserting and removing items.

The most commonly used Container classes are Ext.panel.Panel, Ext.window.Window and Ext.tab.Panel. If you do not need the capabilities offered by the aforementioned classes you can create a lightweight Container to be encapsulated by an HTML element to your specifications by using the autoEl config option.

这意味着 Panel 扩展了 Container,这意味着它可以做更多的事情。例如它有一个 header 并支持 dokedItems(即工具栏),可以关闭(也比较两个组件的其他事件),而容器默认没有这些东西。

一般的经验法则是:当您不需要面板的功能时,请始终使用简单的容器,即当您只需要容纳其他 child 时。

关于javascript - Extjs 中的容器与面板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22857918/

相关文章:

javascript - 在单击的图像顶部应用彩色圆圈

javascript - 如何从 "occupying"全局键盘快捷键中停止 Electron?

javascript - 弯 Angular IE 7,8 Issue

css - 我可以在CSS中画对 Angular 线吗?

html - 使用样式表对齐表单

javascript - 函数调用之间 Angular 变量不会为 "unset"

javascript - 如何解码 HTML 中的 base64 html?

html - 表格的背景图片

java - 检查按钮是否存在 Jsoup

jquery - 当浏览器滚动到某个元素时更改该元素的 CSS