Remove Item from page when dropped into a Sortable

3 posts, 0 answers
  1. Bob
    Bob avatar
    138 posts
    Member since:
    Sep 2012

    Posted 06 Oct 2014 Link to this post

    I am trying to implement a screen with Three sortables (left pane, right pane, remove pane). When the user drags an item to the remove sortable I want to remove it from that sortable. (they are deleting it basically)

    I have tried e.item.remove in the change event handler, but that just makes the dragged element show on the screen as well as the new item in the sortable. 

    I have tried to prevent the drop to the new sortable using e.item.PreventDefault and also e.draggableObject.item.preventDefault and then just remove it from the original sortable, but I can't seem to prevent the change.

    Any suggestions on how to do this?
  2. Alexander Valchev
    Alexander Valchev avatar
    2895 posts

    Posted 08 Oct 2014 Link to this post

    Hello Bob,

    Basically you should simply remove the HTML element at the change event handler. I am not sure why this approach does not work in your scenario.
    Could you please check this example and let me know what I am missing?

    Alexander Valchev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Bob
    Bob avatar
    138 posts
    Member since:
    Sep 2012

    Posted 09 Oct 2014 in reply to Alexander Valchev Link to this post

    Hmm... I tried it again and it worked perfectly. I have no idea what I was doing wrong before. 

    Thanks for the sample.
Back to Top