Persist sortable element in dragging source

2 posts, 0 answers
  1. Steve
    Steve avatar
    10 posts
    Member since:
    Jun 2013

    Posted 13 Dec 2016 Link to this post

    I have two sortable divs, configured to allow me to drag element from div A to div B. Working great. The only thing is, my element disappears from div A when I drag it to div B. How can I prevent the element from being removed from div A?

    Thanks in advance!

     

    For reference, below is my code instantiating the sortables:

    $("#leftSide").kendoSortable({
        cursor: "move",
        connectWith: "#rightSide",
        placeholder: placeholder,
        hint: hint
    });
     
    $("#rightSide").kendoSortable({
        cursor: "move",
        placeholder: placeholder,
        hint: hint,
        start: function (e) {
            if (isResizing) {
                e.preventDefault();
            }
        },
        change: function (element, ui) {
            element.item.height(90);
            var myWidth = element.item.width();
            element.item.width(myWidth - 10);
        }
    });
  2. Stefan
    Admin
    Stefan avatar
    503 posts

    Posted 15 Dec 2016 Link to this post

    Hello Steve,

    I noticed that my colleagues Alexander already answered this in the ticket: 1079469.

    I will share the information with the community in case other users have a similar question:

    "You may prevent the end event in order to stop item movement. Note that this will prevent the movement of an item from list A to list B as well. If the end event is prevented you will have to move the items manually(the item have to be re-added on the end event)":

    http://docs.telerik.com/kendo-ui/api/javascript/ui/sortable#events-end

    Regards,
    Stefan
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top