Panel
Panel widget is a general purpose container which may be used to contain child items or html.
A Panel may also dock a header and footer either at top/bottom or left/right:
const panel = new Panel({
items : {
customerName : { type : 'text', placeholder: 'Text' },
},
header : {
title : 'Customer Details'
}
});
Toolbars with buttons and other widgets
The Panel has two built-in toolbars, tbar and bbar, which are toolbars docked to the top and bottom of the panel. You can easily add any widgets to them using the code below:
const panel = new Panel({
title : 'A Test Panel',
items : {
customerName : {
type : 'text', placeholder: 'Text'
},
},
bbar : {
items : {
proceedButton : {
text : 'Proceed',
onClick : () => {
alert('Proceeding!');
}
}
}
});
Panel with a form
You can use a Panel to create forms containing any Bryntum widgets. The Panel can load data into its field from a record since it subclasses the Container which has a record config.
Collapsible Panel
Panels can also be collapsible. The collapsible panel can be collapsed and expanded by clicking the icon on the far-right end of the header.
Panel as a drawer
Panels can be used as drawers which slide out from the side of the viewport, by using the drawer config:
Panel with strips
Panels can have strips docked to the top, right, bottom, or left. Strips are widgets that are docked to the panel's sides. The higher the weight assigned to a widget, the closer that widget will be to the panel body.
This is useful for adding slide-out containers to the panel. For example, a settings panel shown on the right as seen below (click the hamburger icon to show the settings panel).
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
This config is used with PanelCollapserOverlay to programmatically control the visibility of the panel's body. In this mode of collapse, the body of a collapsed panel is a floating overlay. Setting this config to
truewill show this element, whilefalsewill hide it. -
By default, tabbing within a Panel is not contained, ie you can TAB out of the Panel forwards or backwards. Configure this as
trueto disallow tabbing out of the Panel, and make tabbing circular within this Panel. -
Controls whether the panel is collapsed (the body of the panel is hidden while only the header is visible). Only valid if the panel is collapsible.
Has a corresponding runtime collapsed property.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of Panel class, or subclass thereof.
-
Identifies an object as an instance of Panel class, or subclass thereof.
-
Controls whether the panel is collapsed (the body of the panel is hidden while only the header is visible). Only valid if the panel is collapsible.
Has a corresponding collapsed config.
-
This property is
trueif the panel is currently collapsing. -
This property is
trueif the panel is currently either collapsing or expanding. -
This property is
trueif the panel is currently expanding.
Functions
Functions are methods available for calling on the class-
Collapse the panel.
-
Expand the panel.