I am showing rows from my collection in a datatable. I have a view in which I destroy a model and once that's done I need to remove the corresponding row in datatable. I am able to destroy the model but don't know how to remove that specific row. The view that handles the rows is like this:
var rowRow = Backbone.View.extend({
tagName: "tr",
events: {
'click .edit':'editrow',
'click .delete':'deleterow'
},
render: function() {
data = this.model.toJSON();
this.$el.html('<td>'+data.name+'</td><td>'+data.email+'</td><td>'+data.contact_number+'</td><td><span id="delete'+data.id+'" class="delete">Delete</span> | <span class="edit">Edit</span></td>');
return this;
},
editrow: function(){
alert("edit");
},
deleterow: function() {
var data = this.model.toJSON();
this.model.destroy({ wait: true, success: function(){ }});
}
})
Just after destruction of model, how can I remove that specific row in datatable?