Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2011
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Two different behaviors with Draggable UI helper clone and non-clone

    From my understanding the helper option with Draggable UI is only a display effect as described here.

    But when using it with tables it appears to be bugged.

    Example:
    http://jsfiddle.net/hmj83/

    Can anyone explain this behavior or give a workaround/ fix?

    Thanks.

  • #2
    New Coder
    Join Date
    Jun 2011
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Can anyone help?

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,461
    Thanks
    11
    Thanked 600 Times in 580 Posts
    if you want it copied, cloning it manually in the dropper seems to work:

    Code:
    $("td").droppable({
        drop: function (event, ui) {
            var node=ui.draggable[0].cloneNode(true);
            $(node).appendTo(this);
        }
    });
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%

  • #4
    New Coder
    Join Date
    Jun 2011
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rnd me View Post
    if you want it copied, cloning it manually in the dropper seems to work:

    Code:
    $("td").droppable({
        drop: function (event, ui) {
            var node=ui.draggable[0].cloneNode(true);
            $(node).appendTo(this);
        }
    });
    Not sure how this is suppose to help, it clones the draggable and places it still in the incorrect location as seen here: http://jsfiddle.net/R8Z4w/

    The non-clone helper is expected to work exactly like the clone helper but not leave a "ghost" image.

  • #5
    New Coder
    Join Date
    Jun 2011
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Still struggling to find a solution.

    I tried messing with the cloning idea that rnd me presented

    $(this).append($(ui.draggable).clone().draggable(ui.draggable.draggable('option')));
    $(ui.draggable).remove();
    The location of the element on drop is still wrong.

    Any help?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •