title: How to implement delete per row for backgrid
body: <p>I've been trying to implement a "delete" button for backgrid rows. A solution seems to be described here:</p>
  
  <p><a href="https://stackoverflow.com/questions/17444408/how-to-add-a-custom-delete-option-for-backgrid-rows">How to add a custom delete option for backgrid rows</a></p>
  
  <p>However, I don't seem to get it working. Here is what I tried:</p>
  
  <pre><code>var DeleteCell = Backgrid.Cell.extend({
      template: _.template('&lt;button&gt;Delete&lt;/button&gt;'),
      events: {
        "click": "deleteRow"
      },
      deleteRow: function (e) {
        console.log("Hello");
        e.preventDefault();
        this.model.collection.remove(this.model);
      },
      render: function () {
        this.el.html(this.template());
        this.delegateEvents();
        return this;
      }
  });
  </code></pre>
  
  <p>and then using it like</p>
  
  <pre><code>var columns = [{
          name: "id", // The key of the model attribute
          label: "ID", // The name to display in the header
          editable: false, // By default every cell in a column is editable, but *ID* shouldn't be
          renderable: false,
          // Defines a cell type, and ID is displayed as an integer without the ',' separating 1000s.
          cell: Backgrid.IntegerCell.extend({
              orderSeparator: ''
          })
      }, {
          name: "weight",
          label: "Hello",
          cell: DeleteCell
      },{
          name: "datemeasured",
          label: "DateMeasured",
          // The cell type can be a reference of a Backgrid.Cell subclass, any Backgrid.Cell subclass instances like *id* above, or a string
          cell: "datetime" // This is converted to "StringCell" and a corresponding class in the Backgrid package namespace is looked up
      },{
          name: "weight",
          label: "Weight",
          cell: "number" // An integer cell is a number cell that displays humanized integers
      }];
  </code></pre>
  
  <p>what I get is an error:</p>
  
  <pre><code>TypeError: this.el.html is not a function
  [Break On This Error]   
  
  this.el.html(this.template());
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>Thanks &amp; cheers</p>