Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Container vs Panel in Extjs

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.

like image 674
xtiger Avatar asked Apr 04 '14 08:04

xtiger


People also ask

What is panel Extjs?

Panel is a container that has specific functionality and structural components that make it the perfect building block for application-oriented user interfaces. Panels are, by virtue of their inheritance from Ext. container. Container, capable of being configured with a layout, and containing child Components.

What is items in Extjs?

This is basically an alias of the component's class. This property provides a shorter alternative to creating objects than using a full class name. Using xtype is the most common way to define component instances, especially in a container.

What is layout in Extjs?

Layout is the way the elements are arranged in a container. It can be horizontal, vertical, or any other. Ext JS has a different layout defined in its library but we can always write custom layouts as well. Sr.No. Layout & Description.


Video Answer


1 Answers

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.

like image 140
V G Avatar answered Sep 30 '22 08:09

V G