Sha256: 20105594f69f270c7331e29bbd5b5dc45fd7437d3b7f59bbf6d9e13192d58edb
Contents?: true
Size: 1.36 KB
Versions: 58
Compression:
Stored size: 1.36 KB
Contents
/** * A table cell using the row model's value of the column attribute as * text. If attribute value is empty, use most specific default * available. * * @param {function|string} [options.column.default] * A function returning a default value for display if attribute * value is empty. * * @param {string} [options.column.contentBinding] * If this is provided, the function `options.column.default` * receives the values of `options.column.contentBinding` and of * this.getModel() via its options hash. No-op if * `options.column.default` is not a function. * * @since 12.0 */ pageflow.TextTableCellView = pageflow.TableCellView.extend({ className: 'text_table_cell', update: function() { this.$el.text(this._updateText()); }, _updateText: function() { if (!!this.attributeValue()) { return this.attributeValue(); } else if (typeof this.options.column.default === 'function') { var options = {}; if (!!this.options.column.contentBinding) { options = { contentBinding: this.options.column.contentBinding, model: this.getModel() }; } return this.options.column.default(options); } else if ('default' in this.options.column) { return this.options.column.default; } else { return I18n.t('pageflow.ui.text_table_cell_view.empty'); } } });
Version data entries
58 entries across 58 versions & 1 rubygems