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.

    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.



  2. Alexander Valchev
    Alexander Valchev avatar
    2895 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.

    Alexander Valchev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top