var MyApp = new Mn.Application();

MyApp.User = Backbone.Model.extend({});

MyApp.UserCollection = Backbone.Collection.extend({
	model : MyApp.User,
	comparator : 'name'
});

MyApp.UserItemView = Mn.ItemView.extend({
	tagName : 'tr',
	template : '#user-list-item',
	
	events: {
		'click': 'highlightName',
		"click button": function(){ alert("delete button was clicked"); }
	},
	
	highlightName: function(e){
		//e.preventDefault();
		this.$el.toggleClass('warning');
	},
	
	deleteClicked : function(e) {
		e.stopPropagation();
		alert("delete button was clicked");
	}
});

MyApp.UsersView = Mn.CompositeView.extend({
	tagName: 'table',
	className: 'table table-hover',
	template: '#user-list',
	childView: MyApp.UserItemView,
	childViewContainer: 'tbody'
});

var RegionContainer = Mn.LayoutView.extend({
	el : '#app-container',
	regions : {
		main : '#main-region'
	}
});

MyApp.on('before:start', function(options) {
	MyApp.regions = new RegionContainer();	  
});

MyApp.on('start', function(options) {
	var users = new MyApp.UserCollection([ {
		name : 'Bob',
		email : 'Brigham',
		role : '555-0163'
	}, {
		name : 'Alice',
		email : 'Arten',
		role : '555-0184'
	}, {
		name : 'Charlie',
		email : 'Campbell',
		role : '555-0129'
	} ]);

	var usersView = new MyApp.UsersView({
		collection : users
	});

	MyApp.regions.main.show(usersView);

	if (Backbone.history) {
		Backbone.history.start();
	}
});

MyApp.start();
@@ -301,17 +301,17 @@
 ame',%0A%09%09
-%22
+'
 click bu
@@ -318,60 +318,36 @@
 tton
-%22: function()%7B alert(%22delete button was c
+.js-delete': 'deleteC
 licked
-%22); %7D
+'
 %0A%09%7D,
@@ -503,15 +503,17 @@
 ;%0A%09%09
+//
 alert(
-%22
+'
 dele
@@ -537,9 +537,98 @@
 cked
-%22
+');%0A%09%09//this.model.collection.remove(this.model);%0A%09%09this.trigger(%22user:delete%22, this.model
 );%0A%09
@@ -1066,16 +1066,42 @@
 ions) %7B%0A
+%09// controller's function%0A
 %09var use
@@ -1369,16 +1369,16 @@
 sView(%7B%0A
-
 %09%09collec
@@ -1396,16 +1396,112 @@
 s%0A%09%7D);%0A%0A
+%09usersView.on(%22childview:user:delete%22, function(childView, model)%7B%0A%09%09users.remove(model);%0A%09%7D);%0A%0A
 %09MyApp.r

add delete