EasyUI Forum
September 14, 2025, 11:01:20 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: layout: expand/ collapse events  (Read 7703 times)
korenanzo
Guest
« 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 !!


Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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)
    }
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!