EasyUI Forum
September 14, 2025, 03:49:46 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: click with draggable  (Read 21585 times)
rljain
Newbie
*
Posts: 5


View Profile
« on: May 17, 2012, 02:46:46 AM »

hello i m using your plugin easyui for darh and drop
but i m not able to click on element after i applied dragging on them
i applied click event to some controls and also want to dragg them
but only dragging is working not clicking
and if i comment the dragging code click work fine
please help me out urgently what is the issue ?
Logged
rljain
Newbie
*
Posts: 5


View Profile
« Reply #1 on: May 22, 2012, 09:29:26 PM »

hey any one out there to help me
it's urgent guys please help me out
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 on: May 23, 2012, 12:10:08 AM »

Please provide some test code to explain more detail about your issue.
Logged
rljain
Newbie
*
Posts: 5


View Profile
« Reply #3 on: May 23, 2012, 12:32:38 AM »

thanks for your consideration

 $(function () {
            $('.ControlContainer a').dblclick(function () {
                alert('hello');
            });
            $('.ControlContainer a').draggable({
                revert: true,
                proxy: 'clone',
                onStartDrag: function () {
                    $(this).draggable('options').cursor = 'not-allowed';
                    $(this).draggable('proxy').css('z-index', 10);
                },
                onStopDrag: function () {
                    $(this).draggable('options').cursor = 'move';
                }
            });
});


problem is that my double click event which is on top not fire when i apply draggable with that if i comment out draggable code double click work fine i want both to work together please help me out
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: May 23, 2012, 05:03:42 AM »

When start dragging an object, its proxy object will display on top of source object. The dblclick event will become invalid. To solve this issue, hide the proxy object and delay its display. The code looks like this:
Code:
$(function () {
         $('.ControlContainer a').dblclick(function () {
             alert('hello');
         });
         $('.ControlContainer a').draggable({
             revert: true,
             proxy: 'clone',
             onStartDrag: function () {
                 $(this).draggable('options').cursor = 'not-allowed';
                 var proxy = $(this).draggable('proxy').css('z-index', 10);
                 proxy.hide();
                 setTimeout(function(){
                proxy.show();
                 }, 500);
             },
             onDrag: function(){
            $(this).draggable('proxy').show();
             },
             onStopDrag: function () {
                 $(this).draggable('options').cursor = 'move';
             }
         });
});

Logged
rljain
Newbie
*
Posts: 5


View Profile
« Reply #5 on: May 23, 2012, 06:53:27 AM »

thank you so much
it's work like a charm now
you rock dude.....
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!