EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: korenanzo on May 19, 2016, 07:45:07 AM



Title: layout: expand/ collapse events
Post by: korenanzo on May 19, 2016, 07:45:07 AM
when closing/opening a  panel, (for example west) the event onCollapse seems be fired when the collapsing animation ends

while the Expand event is fired at the beginning

How can I know  the actual size of the central panel after the resizing operations?

If I measure them in the onExpand  call, I'll get the OLD size !!




Title: Re: layout: expand/ collapse events
Post by: stworthy on May 19, 2016, 11:44:35 PM
Please use the 'onExpand' event of layout. It is triggered after expanding a region panel.
Code:
$('#layout').layout({
    onExpand: function(region){
        var cp = $(this).layout('panel','center');
        var width = cp.panel('panel').outerWidth();
        console.log(width)
    },
    onCollapse: function(region){
        var cp = $(this).layout('panel','center');
        var width = cp.panel('panel').outerWidth();
        console.log(width)
    }
})