Reputation: 319
I have this code for initilazing my sortable ul, but both methods only render 1 item of the list and not the whole of it, with the stop
event everything is fine, but I need to use the change event, what is the problem?
Thanks in advance.
$( "#sortable-ul" ).sortable({
scroll: true,
items: "> li",
change: function() {
console.log($("#sortable-ul").sortable("toArray"));
console.log($("#sortable-ul").sortable("serialize"));
}
});
Upvotes: 0
Views: 963
Reputation: 437
Try this code:
$( "#sortable-ul" ).sortable({
scroll: true,
items: "> li",
update: function() {
console.log($("#sortable-ul").sortable("toArray"));
console.log($("#sortable-ul").sortable("serialize"));
}
});
Upvotes: 2