Sortable: Adding and deleting items from a sortable ordered list causes problems in numbering the items
in Using jQuery UI
•
8 years ago
I have sortable ordered list with a few items. Each item in that list can be deleted and/or moved and I can dynamically add more new items. All works fine as long as I do not add a new item and delete one of the existing one.
Example: I run the code and get a list
1. ABC
2. CDE
3. EFG
4. GHI
5. IJK
I delete "3.", so item "4." moves up and is now "3." on that list, while "5." ist now no "4." So far so good.
If I add a new item it will be added at the end of the list as no "6.", "7." and so on.
But as soon as I delete or add any item I am running into problems with the numbering of the list items. I suddently have a list looking like that
e.g.
1. ABC
3. EFG
3.
GHI
4. IJK
The numbering is no longer correct. What can I do to prevent this
from happening!?
This problem seems to occur only in INTERNET EXPLORER....!!
--> jsFiddle Demo: http://tinyurl.com/kty73o6
Thanks for any advice!
1