Lidarr/src/UI/Cells/TemplatedCell.js

14 lines
482 B
JavaScript
Raw Normal View History

2015-02-03 01:18:45 +00:00
var Marionette = require('marionette');
var NzbDroneCell = require('./NzbDroneCell');
module.exports = NzbDroneCell.extend({
render : function(){
var templateName = this.column.get('template') || this.template;
this.templateFunction = Marionette.TemplateCache.get(templateName);
var data = this.cellValue.toJSON();
var html = this.templateFunction(data);
this.$el.html(html);
this.delegateEvents();
return this;
}
});