Created
July 8, 2013 22:27
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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