关于EasyUI的Layout总结

1、layout以html标签方式建立的

<div id="content" region="center" border="false" class="easyui-layout">
					
					<div id="divPage1"
						data-options="region:'west'"
						style="width: 150px;"></div>
					<div id="divPage2"
						data-options="region:'center',href:'${basePath}/userManage_main.jspx'"></div>
					
				</div>


这样,如果我想重新修改 div id="divPage1"这个layout的href属性,应该怎么实行?

实现方法:

$("#divPage1").panel({region:'west',href:'${basePath}/userManage_left.jspx?width='+width});
$("#divPage1").panel('refresh');


必须执行panel的‘refresh’方法才会生效,因此这个‘userManage_left.jspx’页面会被执行2次。目前我的解决办法是使用js脚本建立的方式来解决。

 

2、用js脚本方式建立的

先建立一个div标签,用于生成layout。

 

<div id="content" />

 

js脚本创建

 

$('#content').layout('add',{   
				    region: 'west',   
				    width: 180,   
				    title: 'West Title',   
				    split: true,   
				    href:'${basePath}/userManage_left.jspx?width='+width,
				    tools: [{   
				        iconCls:'icon-add',   
				        handler:function(){alert('add')}   
				    },{   
				        iconCls:'icon-remove',   
				        handler:function(){alert('remove')}   
				    }]   
				});
				$('#content').layout('add',{   
				    region: 'center',   
				    width: 580,   
				    title: 'center Title',   
				    split: true,   
				    href:'${basePath}/userManage_main.jspx',
				    tools: [{   
				        iconCls:'icon-add',   
				        handler:function(){alert('add')}   
				    },{   
				        iconCls:'icon-remove',   
				        handler:function(){alert('remove')}   
				    }]   
				});


 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值