I have a several lists, on different pages, that share jQuery code for allowing them to be sorted:
$('.sortable_list').sortable({
placeholder: 'placeholder',
items: '.sortable_item',
axis: 'y',
containment: 'parent',
tolerance: 'pointer',
update: function(event, ui) {
submitForm();
}
});
I’ve now got a requirement to modify a radio button when one of the lists is sorted.
Rather than having to duplicate the sortable code I was hoping to be able to use .live() or something similar to listen for a change or update on the list, but after trying to attach it to various places I’ve yet to find any that work:
$('.sortable_list').live('update', function() {
console.log('hello');
});
Is it possible? What am I doing wrong?
Have you tried binding to “sortupdate”?
Most jQuery-plugin events are namespaced in some manner or another.