PDA

View Full Version : some questions about gxt



nks14
24 Aug 2009, 8:57 AM
hi. i have some questions about gxt. i'm very new at this and i don't understand the basics.
so, my questions are:

1. what's the difference between viewport/ layout container/ content panel/ filllayout
2. in a borderlayout can i insert another borderlayout?
3. can i add multiple viewports?

thanks.

Arno.Nyhm
26 Aug 2009, 3:52 AM
i try to answer your question as good as i can.



1. what's the difference between viewport/ layout container/ content panel/ filllayout

i think most questions are answered by the api:

Viewport
http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/widget/Viewport.html

A LayoutContainer that fills the browser window and monitors window resizing. Viewports are best used for applications that will fill the browser without window scrolling. Children of the viewport can allow scrolling.

LayoutContainer
http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/widget/LayoutContainer.html

A Container that lays out its children using a Layout. Layouts are responsible for connecting the child components to the container. Layouts are very flexible as they can create any internal element structure, inserting its child components at any location. For example, a TableLayout lays out its children using HTML tables.

ContentPanel
http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/widget/ContentPanel.html

ContentPanel is a component container that has specific functionality and structural components that make it the perfect building block for application-oriented user interfaces. The Panel contains bottom and top toolbars, along with separate header, footer and body sections. It also provides built-in expandable and collapsible behavior, along with a variety of pre-built tool buttons that can be wired up to provide other customized behavior.

FillLayout
http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/widget/layout/FillLayout.html

FillLayout places its components in a single row or column, forcing them to be the same size.
see all possible layouts here:
http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/widget/Layout.html

Summary
if you look in the javadoc in the classtree then you see which object extends which.

viewport is a special layoutcontainer
layoutcontainer uses layout to place the items
contentpanel is a special layoutcontainer
filllayout is a special layout (which uses layoutcontainer)





2. in a borderlayout can i insert another borderlayout?

i think that you can nest each layout into other layouts.



3. can i add multiple viewports?

i dont know if its possible. but i dont know if it makes sense, because a viewport uses the maximum browser window so that the second viewport is not visible.