v7.3.0

Panel
Widget

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).

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • revealed : Boolean
    private

    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 true will show this element, while false will 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 true to 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.

  • An icon to show before the title. Either pass a CSS class as a string, or pass a DomConfig object describing an element to represent the icon.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isPanel : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of Panel class, or subclass thereof.
  • isPanel : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of Panel class, or subclass thereof.
  • bbar : Toolbar
    READONLY

    Get toolbar Toolbar docked to the bottom of the panel

    Has a corresponding bbar config.

  • tbar : Toolbar
    READONLY

    Get toolbar Toolbar docked to the top of the panel

    Has a corresponding tbar config.

  • 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.

  • collapsing : Boolean
    READONLY

    This property is true if the panel is currently collapsing.

  • collapsingExpanding : Boolean
    internal
    READONLY

    This property is true if the panel is currently either collapsing or expanding.

  • expanding : Boolean
    READONLY

    This property is true if the panel is currently expanding.

Functions

Functions are methods available for calling on the class

    Events

    Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

    Event handlers

    Event handlers are callbacks called as a result of certain actions in this class

    Type definitions

    CSS variables

    CSS variables that can be set to adjust appearance
    Name Description
    --b-default-panel-transition The default set of transitions which applies to the panel's encapulating element Subclasses may add their own using this variable followed by their own transitions.
    --b-panel-background Panel background-color
    --b-panel-border Panel border
    --b-panel-bottom-toolbar-background Bottom toolbar background
    --b-panel-bottom-toolbar-padding Bottom toolbar padding
    --b-panel-drawer-box-shadow Box-shadow for drawer panels
    --b-panel-gap Gap between items in the panel
    --b-panel-header-background Header background
    --b-panel-header-border-bottom Header bottom border
    --b-panel-header-color Header color
    --b-panel-header-font-size Header font-size
    --b-panel-header-font-weight Header font-weight
    --b-panel-header-gap Gap between the header's different parts
    --b-panel-header-padding Header padding
    --b-panel-header-text-align Header text-align
    --b-panel-overlay-border Panel border when overlaid
    --b-panel-overlay-box-shadow Box-shadow for overlaid panel
    --b-panel-padding Panel padding
    --b-panel-top-toolbar-border-radius Top toolbar border-radius (only applies when there is a header)
    --b-panel-top-toolbar-margin-inline Top toolbar margin-inline (only applies when there is no header)
    --b-panel-with-header-padding Panel padding when there is a header
    type: panel

    Source path

    Core/widget/Panel.js

    Contents