EasyUI Forum
April 28, 2024, 01:06:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: collapsing panel when moving  (Read 16316 times)
alex.capurro
Newbie
*
Posts: 25


View Profile Email
« on: May 16, 2012, 12:12:47 AM »

I would like to know if its possible to collapse a panel when the user begins to move it.

In this post (http://www.jeasyui.com/forum/index.php?topic=270.0) there is an example of hiding the panel contents when the user is dragging. I have tried modifying the example code pasted in this thread but i cant seem to make the panel collapse. Could someone suggest a way please?

All i would like to see is that when the user starts to drag the panel it should collapse. Doing this means the user can move the panels much more quickly and fluid since big panels with data can make the dragging movement very slow and in some cases not functional at all.

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


View Profile Email
« Reply #1 on: May 16, 2012, 02:07:46 AM »

Why not override the dragging proxy, it is more useful and flexible.

Below code demonstrate the collapse and expand feature:
Code:
$('#pp').portal({
border:false,
fit:true
});
$('div.portal-p').each(function(){
var pp = $(this);
pp.panel('options').onMove = function(){
$(this).panel('expand'); // when moved expand the panel
};
pp.panel('panel').draggable({
onBeforeDrag:function(e){
e.data.startTop = $(this).position().top + $('#pp').scrollTop();
pp.panel('collapse'); // when start moving collapse the panel
}
});
});
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!