Sets or gets the layout. This property determines the position of the docking layout
elements and their characteristics. The first member of the layout array should
always be an item of type 'layoutGroup'.
Each object in the layout array can have the following properties, with some restrictions based on the type
:
-
type. Possible values:
- 'layoutGroup' - container for other groups. It has no visual features. The root item is always of this type.
- 'tabbedGroup' - a group that contains layoutPanels. It is represented by a jqxWindow-like
panel with a bottom-aligned jqxRibbon inside.
- 'documentGroup' - a group that contains documentPanels. It is represented by a top-aligned
jqxRibbon.
- 'autoHideGroup' - a group that contains layoutPanels. It is represented by a jqxRibbon
with
mode: 'popup'
. Each ribbon item has a jqxWindow-like panel in
its content. This group has to be either the first or the last child item of its
parent layoutGroup.
- 'layoutPanel' - a panel that can be inserted in a tabbedGroup or autoHideGroup.
When it is in a tabbedGroup it is represented by a ribbon item and in an autoHideGroup
- by a jqxWindow-like panel inside a ribbon item.
- 'documentPanel' - a panel that can be inserted in a documentGroup. It is represented
by a ribbon item.
- 'floatGroup' - a floating group that can contain a tabbedGroup or a layoutPanel.
It is represented by a jqxWindow. Initial
floatGroups have to be defined after the root layoutGroup in the layout array.
-
alignment - sets the alignment of an autoHideGroup. Possible values:
- 'left'
- 'right'
- 'top'
- 'bottom'
-
allowClose - applicable to tabbedGroups, floatGroups, layoutPanels
and documentPanels. If set to false, the group/panel cannot be closed.
-
allowPin - applicable only to tabbedGroups. If set to false,
the group cannot be pinned.
-
allowUnpin - applicable only to autoHideGroups. If set to false,
the group cannot be unpinned.
-
contentContainer - indicates which HTML element has the content
of the panel. The required value is the value of an existing HTML element's data-container
attribute. N/A to groups.
-
height - sets the height of a group (N/A to panels). Used only
if the parent group's orientation is 'vertical' or for floatGroups. The heights
of all such groups have to be set either in pixels or percents (not a mix of both).
-
initContent - a callback function to be called when a panel is
opened for the first time. Useful for initializing widgets in panels. N/A to groups.
-
minHeight - sets the minimumn height (in pixels) of a group which
is vertically aligned within its parent group. Disregards the value of the minGroupHeight
property.
-
minWidth - sets the minimumn width (in pixels) of a group which
is horizontally aligned within its parent group. Disregards the value of the minGroupWidth
property.
-
orientation - orients child items either horizontally or vertically.
Applicable only to layoutGroups. Possible values:
-
pinnedHeight - sets what the height of a tabbedGroup will be after
it is pinned.
-
pinnedWidth - sets what the width of a tabbedGroup will be after
it is pinned.
- popupContentSize - sets the size of the content part of an autoHideGroup's pop-up. Applicable to autoHideGroups and tabbedGroups (in this case, the property takes effect after a tabbedGroup is pinned).
-
position - sets the initial position of a floatGroup. The position
property is an object with the following properties:
- selected - sets whether a panel is initially selected. N/A to groups.
-
title - sets the title of a panel. Represented by the corresponding
ribbon item's title. N/A to groups.
-
unpinnedHeight - sets what the height of an autoHideGroup will
be after it is unpinned.
-
unpinnedWidth - sets what the width of an autoHideGroup will be
after it is unpinned.
-
width - sets the width of a group (N/A to panels). Used only if
the parent group's orientation is 'horizontal' or for floatGroups. The widths of
all such groups have to be set either in pixels or percents (not a mix of both).
-
items - an array of item objects with the fields described above.
N/A to panels.
Code examples
Set the layout
property.
var layout = [{
type: 'layoutGroup',
orientation: 'horizontal',
items: [{
type: 'autoHideGroup',
alignment: 'left',
width: 80,
unpinnedWidth: 200,
items: [{
type: 'layoutPanel',
title: 'Toolbox',
contentContainer: 'ToolboxPanel'
}, {
type: 'layoutPanel',
title: 'Help',
contentContainer: 'HelpPanel'
}]
}, {
type: 'layoutGroup',
orientation: 'vertical',
width: 500,
items: [{
type: 'documentGroup',
height: 400,
minHeight: 200,
items: [{
type: 'documentPanel',
title: 'Document 1',
contentContainer: 'Document1Panel'
}, {
type: 'documentPanel',
title: 'Document 2',
contentContainer: 'Document2Panel'
}]
}, {
type: 'tabbedGroup',
height: 200,
pinnedHeight: 30,
items: [{
type: 'layoutPanel',
title: 'Error List',
contentContainer: 'ErrorListPanel'
}]
}]
}, {
type: 'tabbedGroup',
width: 220,
minWidth: 200,
items: [{
type: 'layoutPanel',
title: 'Solution Explorer',
contentContainer: 'SolutionExplorerPanel'
}, {
type: 'layoutPanel',
title: 'Properties',
contentContainer: 'PropertiesPanel'
}]
}]
}, {
type: 'floatGroup',
width: 500,
height: 200,
position: {
x: 350,
y: 250
},
items: [{
type: 'layoutPanel',
title: 'Output',
contentContainer: 'OutputPanel'
}]
}];
$('#jqxDockingLayout').jqxDockingLayout({ width: 800, height: 600, layout: layout });
Get the layout
property.
var layout = $('#jqxDockingLayout').jqxDockingLayout('layout');