容器vs面板在Extjs [英] Container vs Panel in Extjs

查看:125
本文介绍了容器vs面板在Extjs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于Extjs的问题



我已经阅读了有关Sencha文档的官方文档,但我对2种组件有一些困惑。这是容器和面板。



容器和面板有什么区别?应该使用哪种方式?



非常感谢任何答案。

解决方案

摘自容器文档


可能包含其他组件的任何Ext.Component的基类。
容器处理包含项目的基本行为,即
添加,插入和删除项目。



最常用的Container类是 Ext.panel.Panel
Ext.window.Window和Ext.tab.Panel。如果您不需要上述类提供的
功能,您可以使用autoEl config选项创建一个
轻量级容器,以通过HTML元素封装到
规范中。


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



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


I have a question about Extjs

I have read the official document on Sencha doc but I have some confusion about 2 kinds of Component .That's the Container and the Panel.

What is the difference between Container and Panel? Which should be used in which case?

Any answer are very appreciated.

解决方案

Excerpt from the 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.

This means, that the Panel extends the Container, meaning it can do more stuff. For example it has a header and supports dokedItems (i.e toolbars), can be closed (compare also the other events of the two components), while the container does not have by default such things.

The general rule of thumb is: use simple containers always when you do not need the features of the panel, i.e when you just need to host other children.

这篇关于容器vs面板在Extjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆