Skip to content

Instantly share code, notes, and snippets.

@jrumbut
Created July 8, 2013 22:27
Show Gist options
  • Save jrumbut/5953022 to your computer and use it in GitHub Desktop.
Save jrumbut/5953022 to your computer and use it in GitHub Desktop.
A content-free cell made just to delete the row that contains it using the fabulous Backgrid.js library.
DeleteCell = Backgrid.Cell.extend({
template: _.template('<button>Delete</button>')
events:
"click": "deleteRow"
deleteRow: (e) ->
e.preventDefault()
@model.collection.remove(@model)
render: ->
@$el.html(@template())
@delegateEvents()
@
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment