const _ = require('underscore'); const CoreView = require('backbone/core-view'); module.exports = CoreView.extend({ tagName: 'tr', initialize: function () { this.model.bind('change', this.render, this); this.model.bind('destroy', this.clean, this); this.model.bind('remove', this.clean, this); this.model.bind('change', this.triggerChange, this); this.model.bind('sync', this.triggerSync, this); this.model.bind('error', this.triggerError, this); this.add_related_model(this.model); this.order = this.options.order; }, triggerChange: function () { this.trigger('changeRow'); }, triggerSync: function () { this.trigger('syncRow'); }, triggerError: function () { this.trigger('errorRow'); }, valueView: function (colName, value) { return value; }, render: function () { var self = this; var row = this.model; var tr = ''; var tdIndex = 0; var td; if (this.options.row_header) { td = '