1:基本知识
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, capable of being configured with a layout, and containing child Components.
When either specifying child items of a Panel, or dynamically adding Components to a Panel, remember to consider how you wish the Panel to arrange those child elements, and whether those child elements need to be sized using one of Ext's built-in layout
schemes. By default, Panels use the ContainerLayout scheme. This simply renders child components, appending them one after the other inside the Container, and does not apply any sizing at all.
A Panel may also contain bottom and top toolbars, along with separate header, footer and body sections (see frame for additional information).
Panel also provides built-in expandable and collapsible behavior, along with a variety of prebuilt tool buttons that can be wired up to provide other customized behavior. Panels can be easily dropped into any Container or layout, and the layout and rendering pipeline is completely managed by the framework.
面板由以下几个部分组成:一个顶级工具栏、一个底部工具栏、面板头部、面板尾部、面板主区域。面板类中还内置了面板展开、关闭等功能,并提供了一系列可重用的的工具按钮,使得我们可以轻松实现自定义的行为,面板可以放入其他任何容器中,面板自身也是一个容器,它又可以包含各种其他组件
2:代码例子panel.jsp
3:程序效果图
由上图可以看出,标题栏右侧放了一排小按钮,实现了一些体贴的功能,如关闭、刷新、最小化、最大化、设置等。如果设置了collapsible属性,可以看到一个向上的箭头,它的作用就是缩放面板Panel。顶部工具栏有“欢迎您登录聊天系统”字眼,底部工具栏有确定和重置按钮,这两个工具栏对应的属性分别为tbar(Top bar)和bbar(Bottom bar)