jQWidgets Forums

jQuery UI Widgets Forums Lists ListBox listbox drop target

This topic contains 3 replies, has 2 voices, and was last updated by  mrallaris 10 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • listbox drop target #60834

    mrallaris
    Participant

    Hello,

    I am trying to implement something that is nearly identical to your Drag & Drop demo on the ListBox page. Specifically I want to drag items from one listbox to another and also use dragging to re-order items within a listbox.

    My problem is that I don’t know how to determine on which widget the item was dropped. I have scoured your documentation and forums and I can see that when the jqxDragDrop object is used there is a dropTarget implemented that has events for when an object is dropped on it. But in the listbox drag and drop demo this object is not used and instead there are properties for allowDrag and allowDrop built-in to the listbox.

    I have also seen in some of your forum posts that you use the coordinates of the dropped object to determine where it was dropped. I tried implementing this but I cannot tell how to know where the item will be dropped based on the coordinates. There are scenarios where the item is dragged so that it spans both listboxes but gets dropped into one or the other and I’m not sure how to know which it will be.

    Any help would be greatly appreciated.

    Thanks!

    listbox drop target #60835

    mrallaris
    Participant

    Hi Again – a little more information ….

    I also wanted to mention that I read a forum post which talks about a dragEnd function that has dragItem and dropItem as arguments. This looks like it is exactly what I need except that no matter where I drop the item, dropItem is always undefined.

    Thanks,

    listbox drop target #60849

    Peter Stoev
    Keymaster

    Hi mrallaris,

    I think that this can be solved very easily – just compare the items count in the dragStart and dragEnd event handlers.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    listbox drop target #60880

    mrallaris
    Participant

    Yup – that works perfectly!

    Thanks as always for your timely and effective help. I love this product!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.