Skip to content

Instantly share code, notes, and snippets.

@jstotz
Forked from igustafson/settings.snippet.coffee
Created May 3, 2011 21:29
Show Gist options
  • Save jstotz/954294 to your computer and use it in GitHub Desktop.
Save jstotz/954294 to your computer and use it in GitHub Desktop.
Settings TableView with delete link
rowView =
events:
'click .destroy': 'destroy'
destroy: (event)->
event.preventDefault()
if confirm("Are you sure you want to delete " + setting.get("id") + "?")
@model.destroy()
class TableView extends Sagamore.Views.CollectionTable
className: "settings"
fields: [
{id: 'actions', title: '', template: '<a href="#" class="destroy">Delete</a>'}
{id: 'id', title: 'Name', sort: true, template: idTemplate}
{id: 'stringValue', title: 'Value'}
]
rowView: rowView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment