EasyUI Forum
September 14, 2025, 11:07:41 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: Problem with droppable position  (Read 10213 times)
rljain
Newbie
*
Posts: 5


View Profile
« on: May 31, 2012, 09:44:22 PM »

i am using droppable functionality of your plugin
my scenario is that i have two divs i have some controls in first div and then and drag and drop that controls on second div by making clone of them
is there any method to get the above and below controls when we drop it on second div so i can place this control between them
how to get it done please help it's urgent
« Last Edit: June 01, 2012, 09:57:44 PM by rljain » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 04, 2012, 01:23:02 AM »

When dragging an element on the droppable area, append the element directly. When dragging an element on a droppable item, insert the element before the droppable item. The key code below shows how to implement this functionality:
Code:
var drop_conf = {
onDrop:function(e,source){
if ($(this).hasClass('drag')){ // drop on inner item
$(source).insertBefore(this);
} else {
$(this).append(source)
}
$(this).removeClass('over');
$(source).droppable(drop_conf);
e.stopPropagation();
}
}
$('#target').droppable(drop_conf);
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!