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

Sortable end event: too many items in list

1 Answer 52 Views
Sortable
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 22 Apr 2015, 04:30 PM

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

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 24 Apr 2015, 09:18 AM
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!
 
Tags
Sortable
Asked by
Ed
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or