EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: LWardwell on December 16, 2011, 02:42:37 PM



Title: Handle Layout Expand/Collapse Events
Post by: LWardwell on December 16, 2011, 02:42:37 PM
Is it possible on the layout, not portal layout, to trap the expand/collapse or resize events? Thanks


Title: Re: Handle Layout Expand/Collapse Events
Post by: stworthy on December 16, 2011, 06:37:34 PM
Get the layout panel and add event handler:
Code:
var p = $('body').layout('panel','west').panel({
onCollapse:function(){
alert('collapse');
},
onExpand:function(){
alert('expand');
},
onResize:function(){
alert('resize')
}
});


Title: Re: Handle Layout Expand/Collapse Events
Post by: LWardwell on January 06, 2012, 09:33:48 AM
Is it possible to create a layout with a panel(s) initially collapsed, rather than having to call the collapse method?


Title: Re: Handle Layout Expand/Collapse Events
Post by: stworthy on January 09, 2012, 02:06:49 AM
To initialize the collapsed layout panel, set 'collpased' property to true. Please download the layout plugin from http://www.jeasyui.com/easyui/plugins/jquery.layout.js to support this feature.

Code:
<body class="easyui-layout">
<div region="north" border="false" style="height:60px;background:#B3DFDA;padding:10px">north region</div>
<div region="west" split="true" collapsed="true" title="West" style="width:150px;padding:10px;">west region</div>
<div region="east" split="true" title="East" style="width:100px;padding:10px;">east region</div>
<div region="south" border="false" style="height:50px;background:#A9FACD;padding:10px;">south region</div>
<div region="center" title="Main Title">
</div>
</body>