Skip to content

Commit

Permalink
always call attach() and detach() on the row views when doing those t…
Browse files Browse the repository at this point in the history
…hings
  • Loading branch information
reconbot committed May 30, 2012
1 parent b6dfe5f commit 5d1219b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion table.js
Expand Up @@ -227,11 +227,12 @@
var cid = model.cid;
var row = this.rows[cid];
this.tbody.append(row.el);
row.attach();
}, this);
},

detatchAll: function(){
this.tbody.find('tr').detach();
_.forEach(this.rows, function(m){m.detach();});
},

removeAll: function(){
Expand Down Expand Up @@ -259,6 +260,7 @@

var row = this.rows[cid] = new this.opt.view(data);
this.tbody.append(row.el);
row.attach();

if(this.collection.length === 1){
this.removeEmpty();
Expand Down Expand Up @@ -321,6 +323,10 @@ BTS.SortableTableRow = Backbone.View.extend({

detach: function(){
this.$el.detach();
},

attach: function(){
//no-op
}

});
Expand Down

0 comments on commit 5d1219b

Please sign in to comment.