Sortable end event: too many items in list

2 posts, 0 answers
  1. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 22 Apr 2015 Link to this post

    I've created a jsFiddle to show the issue.

    http://jsfiddle.net/edsinek/wh9wf5fq/

    drag and reorder the items and in the end event, there should be 2 items in the list, but it shows there are 3. How can I make sure I always have 2 items in the end event?

    In the real code, I have a numbered list and when I reorder, I want to update the numbers, but the incorrect number of items is interfering with the re-numbering code.

    Thanks,

    --Ed

  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 24 Apr 2015 Link to this post

    Hello Ed,

    Thank you for the example.

    The additional element is the placeholder, by design it is appended in the Sortable container which is why at the end event you find 3 <li> elements. For more information please see this help article:
    You may use the change event where the placeholder will be already removed by the framework.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top