更新时间:2023-12-03 16:57:58
您可以制作自定义单元格。
You can make a custom cell.
var DeleteCell = Backgrid.Cell.extend({
template: _.template(" PUT YOUR HTML BUTTON TEMPLATE HERE "),
events: {
"click": "deleteRow"
},
deleteRow: function (e) {
e.preventDefault();
this.model.collection.remove(this.model);
},
render: function () {
this.$el.html(this.template());
this.delegateEvents();
return this;
}
});