This is a migrated thread and some comments may be shown as answers.

Persist sortable element in dragging source

1 Answer 63 Views
Sortable
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 13 Dec 2016, 08:20 PM

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);
    }
});

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Dec 2016, 02:16 PM
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 (charts) and form elements.
Tags
Sortable
Asked by
Steve
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or