Reputation: 1848
I'm confused about the JQuery UI sortable events handler. How can I make a function fire everytime there is a change e.g. $("#tablename tbody").sortable({ change: myfunction() });
Upvotes: 0
Views: 348
Reputation: 14953
"change" event will be fired only if DOM position has changed. You can use sort event to catch any sorting if that is what you want.
Upvotes: 0
Reputation: 16754
in this way:
$( ".selector" ).sortable({
change: function(event, ui) {
//code goes here
}
});
or
$( ".selector" ).bind( "sortchange", function(event, ui) {
//code goes here
});
Documentation: http://jqueryui.com/demos/sortable/#event-change
Upvotes: 1