jq easy ui lay out 使用方法

使用 jq easy ui 首先需要在文档头目引入相应的css ,jq文件`
引入顺序按照如下代码:

  
   
   
     

lay out 布局就是在一个div中添加一个class属性为 easyui-layout 在div的内部有可分为 west :左 ,north:上 ,east:右,south:上 center:中区域
其中:center中心区域 必须有

例如:`

上端内容
下端内容
中间内容

以下属性用法如下:
布局选项(Layout Options)
名称 类型 描述 默认值
fit boolean 当设置为 true 时,就设置布局(layout)的尺寸适应它的父容器。当在 ‘body’ 标签上创建布局(layout)时,它将自动最大化到整个页面的全部尺寸。 false

区域面板选项(Region Panel Options)
区域面板选项(Region Panel Options)是定义在面板(panel)组件中,下面是一些共同的和新增的属性:
名称 类型 描述 默认值
title string 布局面板(layout panel)的标题文本。 null
region string 定义布局面板(layout panel)的位置,其值是下列之一:north、south、east、west、center。
border boolean 当设置为 true 时,就显示布局面板(layout panel)的边框。 true
split boolean 当设置为 true 时,就显示拆分栏,用户可以用它改变面板(panel)的尺寸。 false
iconCls string 在面板(panel)头部显示一个图标的 CSS class。 null
href string 从远程站点加载数据的 URL 。 null
collapsible boolean 定义是否显示可折叠按钮。 true
minWidth number 面板(panel)最小宽度。 10
minHeight number 面板(panel)最小高度。 10
maxWidth number 面板(panel)最大宽度。 10000
maxHeight number 面板(panel)最大高度。 10000
方法
名称 参数 描述
resize none 设置布局(layout)的尺寸。
panel region 返回指定的面板(panel),‘region’ 参数可能的值是:‘north’、‘south’、‘east’、‘west’、‘center’。
collapse region 折叠指定的面板(panel),‘region’ 参数可能的值是:‘north’、‘south’、‘east’、‘west’。
expand region 展开指定的面板(panel),‘region’ 参数可能的值是:‘north’、‘south’、‘east’、‘west’。
add options 添加一个指定的面板(panel),options 参数一个配置对象,更多细节请参阅标签页面板(tab panel)属性。
remove region 移除指定的面板(panel),‘region’ 参数可能的值:‘north’、‘south’、‘east’、‘west’。
各方法例子如下:
1、添加删除区域

	function addPanel(){
			var region = $('#region').val();
			var options = {
				region: region
			};
			if (region=='north' || region=='south'){
				options.height = 50;
			} else {
				options.width = 100;
				options.split = true;
				options.title = $('#region option:selected').text();
			}
			$('#cc').layout('add', options);
		}
		function removePanel(){
			$('#cc').layout('remove', $('#region').val());
		}

2、自适应高度

Auto Height for Layout

This example shows how to auto adjust layout height after dynamically adding items.

Panel Content.

Panel Content.

Panel Content.

Panel Content.

Panel Content.

你可能感兴趣的:(jq easy ui lay out 使用方法)