jQuery EasyUI Layout Plugin - Layout
jQuery EasyUI Plugins
Override the default defaults via $.fn.layout.defaults.
The layout is a container with five regions: north, south, east, west, and center. The center region panel is required, while the edge region panels are optional. Each edge region panel can be resized by dragging its border and collapsed by clicking the collapse trigger. Layouts can be nested, so users can build complex layouts.
Depends on
- panel
- resizable
Usage
Creating a Layout
1. Create a layout from markup.
Add the 'easyui-layout' class to
2. Create a layout on the whole page.
3. Create a nested layout.
Note that the west panel of the inner layout is collapsed.
4. Load content via AJAX.
The layout is created based on panels. Each region panel provides built-in support for dynamically loading content from a URL. Using dynamic loading techniques, users can make their layout pages display faster.
Collapsing a Layout Panel
$('#cc').layout();
// collapse the west panel
$('#cc').layout('collapse','west');
Adding a West Panel via a Tool Button
$('#cc').layout('add',{
region: 'west',
width: 180,
title: 'West Title',
split: true,
tools: [{
iconCls:'icon-add',
handler:function(){alert('add')}
},{
iconCls:'icon-remove',
handler:function(){alert('remove')}
}]
});
Layout Options
| Name | Type | Description | Default value |
|---|---|---|---|
| fit | boolean | When set to true, the layout is sized to fit its parent container. When a layout is created on the 'body' tag, it automatically maximizes to the full size of the page. | false |
Region Panel Options
Region Panel Options are defined in the panel component; the following are some common and additional properties:
| Name | Type | Description | Default value |
|---|---|---|---|
| title | string | The title text of the layout panel. | null |
| region | string | Defines the position of the layout panel; its value is one of: north, south, east, west, center. | |
| border | boolean | When set to true, the border of the layout panel is shown. | true |
| split | boolean | When set to true, the splitter is shown, allowing users to resize the panel. | false |
| iconCls | string | The CSS class of an icon displayed in the panel header. | null |
| href | string | The URL to load data from a remote site. | null |
| collapsible | boolean | Defines whether to show the collapse button. | true |
| minWidth | number | The minimum width of the panel. | 10 |
| minHeight | number | The minimum height of the panel. | 10 |
| maxWidth | number | The maximum width of the panel. | 10000 |
| maxHeight | number | The maximum height of the panel. | 10000 |
Method
| Name | Parameters | Description |
|---|---|---|
| resize | none | Sets the size of the layout. |
| panel | region | Returns the specified panel. Possible values of the 'region' parameter are: 'north', 'south', 'east', 'west', 'center'. |
| collapse | region | Collapses the specified panel. Possible values of the 'region' parameter are: 'north', 'south', 'east', 'west'. |
| expand | region | Expands the specified panel. Possible values of the 'region' parameter are: 'north', 'south', 'east', 'west'. |
| add | options | Adds a specified panel; the options parameter is a configuration object. For more details, see the tab panel properties. |
| remove | region | Removes the specified panel. Possible values of the 'region' parameter are: 'north', 'south', 'east', 'west'. |
jQuery EasyUI Plugins