I’m toying around with backbone.js and try to use jQuery along with it. I have a view and I’d like to react to reorder event. This is my view:
var SortableList = Backbone.View.extend({
el: '#sortable_list',
events: {
'sortupdate': 'onDrop',
'click': 'onClick'
},
initialize: function () {
$(this.el).sortable({})
},
onDrop: function () {
alert('dropped!')
},
onClick: function () {
alert('clicked!')
}
})
So the click event fires fine, but I just can’t figure out how to track a drop/reorder/sortupdate/whatever event.
I don’t know if this is the best method but I currently bind the view to the update method of the Sortable: