Jx.Panel

Extends: Object

Implements: Options, Events, Jx.ContentLoader

A panel is a fundamental container object that has a content area and optional toolbars around the content area.  It also has a title bar area that contains an optional label and some user controls as determined by the options passed to the constructor.

Example

Events

closefired when the panel is closed
collapsefired when the panel is collapsed
expandfired when the panel is opened

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Jx.PanelExtends: Object
Options
idString, an id to assign to the panel’s container
labelString, the title of the Jx Panel
height
collapseboolean, determine if the panel can be collapsed and expanded by the user.
collapseTooltipthe tooltip to display over the collapse button
collapseLabelthe label to use for the collapse menu item
expandLabelthe label to use for the expand menu item
maximizeTooltipthe tooltip to display over the maximize button
maximizeLabelthe label to use for the maximize menu item
closeboolean, determine if the panel can be closed (hidden) by the user.
closeTooltipthe tooltip to display over the close button
closeLabelthe label to use for the close menu item
closedboolean, initial state of the panel (true to start the panel closed), default is false
hideTitleBoolean, hide the title bar if true.
toolbarsarray of Jx.Toolbar objects to put in the panel.
Constructor
Jx.PanelInitialize a new Jx.Panel instance
Options
<Jx.Panel.Options>, <Jx.ContentLoader.Options>
Functions
layoutContentthe sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.
setLabelSet the label in the title bar of this panel
getLabelGet the label of the title bar of this panel
finalizeClean up the panel
maximizeMaximize this panel
setContentset the content of this panel to some HTML
setContentURLSet the content of this panel to come from some URL.
panelContentLoadedWhen the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.
setBusySet the panel as busy or not busy, which displays a loading image in the title bar.
toggleCollapsesets or toggles the collapsed state of the panel.
closeCloses the panel (completely hiding it).

Options

id

String, an id to assign to the panel’s container

label

String, the title of the Jx Panel

height

integer, fixed height to give the panelno fixed height by default.

collapse

boolean, determine if the panel can be collapsed and expanded by the user.  This puts a control into the title bar for the user to control the state of the panel.

collapseTooltip

the tooltip to display over the collapse button

collapseLabel

the label to use for the collapse menu item

expandLabel

the label to use for the expand menu item

maximizeTooltip

the tooltip to display over the maximize button

maximizeLabel

the label to use for the maximize menu item

close

boolean, determine if the panel can be closed (hidden) by the user.  The application needs to provide a way to re-open the panel after it is closed.  The closeable property extends to dialogs created by floating panels.  This option puts a control in the title bar of the panel.

closeTooltip

the tooltip to display over the close button

closeLabel

the label to use for the close menu item

closed

boolean, initial state of the panel (true to start the panel closed), default is false

hideTitle

Boolean, hide the title bar if true.  False by default.

toolbars

array of Jx.Toolbar objects to put in the panel.  The position of each toolbar is used to position the toolbar within the panel.

Constructor

Jx.Panel

Initialize a new Jx.Panel instance

Options

<Jx.Panel.Options>, <Jx.ContentLoader.Options>

Functions

layoutContent

layoutContent: function()

the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.

setLabel

setLabel: function(s)

Set the label in the title bar of this panel

Parameters

s{String} the new label

getLabel

getLabel: function()

Get the label of the title bar of this panel

Returns

{String} the label

finalize

finalize: function()

Clean up the panel

maximize

maximize: function()

Maximize this panel

setContent

setContent : function (html)

set the content of this panel to some HTML

Parameters

html{String} the new HTML to go in the panel

setContentURL

setContentURL : function (url)

Set the content of this panel to come from some URL.

Parameters

url{String} URL to some HTML content for this panel

panelContentLoaded

panelContentLoaded: function(html)

When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.

Parameters

html{String} the html return from xhr.onSuccess

setBusy

setBusy : function(isBusy)

Set the panel as busy or not busy, which displays a loading image in the title bar.

Parameters

isBusy{Boolean} the busy state

toggleCollapse

toggleCollapse: function(state)

sets or toggles the collapsed state of the panel.  If a new state is passed, it is used, otherwise the current state is toggled.

Parameters

stateoptional, if passed then the state is used, otherwise the state is toggled.

close

close: function()

Closes the panel (completely hiding it).

layoutContent: function()
the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.
Extends: Object
setLabel: function(s)
Set the label in the title bar of this panel
getLabel: function()
Get the label of the title bar of this panel
finalize: function()
Clean up the panel
maximize: function()
Maximize this panel
setContent : function (html)
set the content of this panel to some HTML
setContentURL : function (url)
Set the content of this panel to come from some URL.
panelContentLoaded: function(html)
When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.
setBusy : function(isBusy)
Set the panel as busy or not busy, which displays a loading image in the title bar.
toggleCollapse: function(state)
sets or toggles the collapsed state of the panel.
close: function()
Closes the panel (completely hiding it).
ContentLoader is a mix-in class that provides a consistent mechanism for other Jx controls to load content in one of four different ways: