Sha256: bb6221fa8d71d9db036a1f3880ac26b70d04fb296b46ccf7f892cf10e7ec70d0
Contents?: true
Size: 1.12 KB
Versions: 58
Compression:
Stored size: 1.12 KB
Contents
pageflow.TableRowView = Backbone.Marionette.View.extend({ tagName: 'tr', events: { 'click': function() { if (this.options.selection) { this.options.selection.set( this.selectionAttribute(), this.model ); } } }, initialize: function() { if (this.options.selection) { this.listenTo(this.options.selection, 'change', this.updateClassName); } }, render: function() { _(this.options.columns).each(function(column) { this.appendSubview(new column.cellView(_.extend({ model: this.model, column: column, attributeTranslationKeyPrefixes: this.options.attributeTranslationKeyPrefixes }, column.cellViewOptions || {}))); }, this); this.updateClassName(); return this; }, updateClassName: function() { this.$el.toggleClass('is_selected', this.isSelected()); }, isSelected: function() { return this.options.selection && this.options.selection.get(this.selectionAttribute()) === this.model; }, selectionAttribute: function() { return this.options.selectionAttribute || 'current'; } });
Version data entries
58 entries across 58 versions & 1 rubygems