I’m using jQuery v1.8.0 and jQuery UI v1.8.22.
The documentation said that you can trigger sortupdate by:
$(".selector").bind("sortupdate", function (event, ui) {
// do something here
});
$(".selector").trigger("sortupdate");
But this doesn’t seem to be the case because ui is undefined. Is there any other way to make this work / trigger events on sortupdate?
sortupdateis triggered once sorting has stopped and the DOM has changed. It should happen automatically and is not intended to be ‘triggered’ in any other way. That’s not to say you can’t trigger the event, however, if you don’t pass it ‘ui’, then it’ll be undefined.When the sortable triggers the event, ui will not be undefined.