Dynamically Add Items
Any documentation or demos for dynamically adding items with working event handlers? For instance adding a list item with delete?
Also interested in this. I figured simply calling the function again would do the trick, but then I just get a bazillion "Uncaught TypeError: Cannot read property 'left' of undefined" errors as I try to drag.
Edit- seems to be jQuery UI that's not updating rather than the plugin. Not sure of the solution for that.
Exemple:
$('#addNode').click(function(){
$('ol.sortable').append('<li id="item-' + (new Date()).getTime() + '"><div>Новыей элемент</div></li>');
$('ol.sortable').nestedSortable('refresh');
});
Yes, that works. Would be nice if that were added into the documentation!
As far as I have used the plugin, we can simply insert the html and it will display fine (with some display glitch). No need to refresh.
(maybe we are talking about different version, I use the 2.0alpha)
Claud, not working you solution. Classes does not applyed until item is not be changed or moved.
Change a bit (so that the menuItem will be added like in the example but it can´t be deleted...any tipps?