I’m using jquery ui to make a sortable list but it doesn’t work and I just can’t understand why. The ul element receives the class ‘ui-sortable’ but nothing happens.
I made an example as the original js has many more unrelated objects.
The example is here. To make it ‘work’ just click the button with ‘editar’ in it.
After wasting a whole weekend with this issue, I ended up understanding what happened.
As this comment points out: when adding elements in the dom using, .html(), it loses its events and data and that’s why I wasn’t able to clone a previously sortable ul.
I solved my issue assuring that the list was already at the dom before applying the sortable method to it.
Fabrício and Guy, thanks a lot for your help!