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

3 posts, 1 answers
  1. Vikash
    Vikash avatar
    14 posts
    Member since:
    Nov 2013

    Posted 26 Jun 2014 Link to this post

    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. Vikash
    Vikash avatar
    14 posts
    Member since:
    Nov 2013

    Posted 26 Jun 2014 Link to this post

    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.
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 26 Jun 2014 Link to this post

    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!
     
Back to Top