var BoxList = View.extend({ el: "#boxes", initialize: function(){ this.__super__.initialize.call(this) this.template = this.$(".template").html() this.$table = this.$("table") }, load: function(data){ data.forEach(this.appendBox.bind(this)) }, appendBox: function(box){ var $row = $( this.parseBox(box) ) this.$table.append($row) }, parseBox: function(box){ var t = this.template .replace(/{{box}}/g, box.mbox.split(".")[1]) .replace(/{{count}}/g, box.count) return t }, })