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

Restrict sorting of some elements under interconnected areas but allow sorting in there own respective area.

2 Answers 30 Views
Sortable
This is a migrated thread and some comments may be shown as answers.
Vikash
Top achievements
Rank 1
Vikash asked on 26 Jun 2014, 07:47 AM
I have two sortable areas connected to each other. Both of the areas can have sortable in there own respective area and also to each other.

There are certain elements that I want restrict for getting dragged to each other but should be allowed to be sorted in there own area.

Is it possible to achieve this with current release. If yes, please provide some guideline.

2 Answers, 1 is accepted

Sort by
0
Vikash
Top achievements
Rank 1
answered on 26 Jun 2014, 08:07 AM
Putting an example for further explanation, this link has two way sorting http://demos.telerik.com/kendo-ui/sortable/linkedlists but what I need to achieve is to restrict "Apricots" to get dragged under first area and at same time sorting should be allowed in original container of "Apricots". 

Cancelling the drag on "change" event also can work out for me but not finding proper way to achieve it.
0
Accepted
Alexander Valchev
Telerik team
answered on 26 Jun 2014, 10:51 AM
Hello Vikash,

The scenario which you described is possible. Basically you should hook up to the end event and prevent the movement of the sorted item in the following way:
end: function(e) {
  if (e.action === "receive" && e.item.text() === "Apricots") {
    e.preventDefault();
  }
}

For your convenience I prepared a small example: http://trykendoui.telerik.com/@Alexander/aCiL

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Sortable
Asked by
Vikash
Top achievements
Rank 1
Answers by
Vikash
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or