* @default null
*/
+ /**
+ * Set a custom text for the actions column header row when actions buttons
+ * are present.
+ *
+ * @name LuCI.form.TableSection.prototype#actionstitle
+ * @type string|function
+ * @default null
+ */
+
/**
* Specify a maximum amount of columns to display. By default, one table
* column is rendered for each child option of the form section element.
dom.content(trEl.lastElementChild, opt.title);
}
- if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable)
+ if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable) {
+ const rawTitle = (this.actionstitle !== undefined) ? this.actionstitle : null;
+ const actionsTitle = (typeof rawTitle === 'function') ? rawTitle.call(this, has_action) : rawTitle;
trEl.appendChild(E('th', {
'class': 'th cbi-section-table-cell cbi-section-actions'
- }));
+ }, (actionsTitle !== undefined) ? actionsTitle : null));
+ }
trEls.appendChild(trEl);
}
(typeof(opt.width) == 'number') ? `${opt.width}px` : opt.width;
}
- if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable)
+ if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable) {
+ const rawTitle = (this.actionstitle !== undefined) ? this.actionstitle : null;
+ const actionsTitle = (typeof rawTitle === 'function') ? rawTitle.call(this, has_action) : rawTitle;
trEl.appendChild(E('th', {
'class': 'th cbi-section-table-cell cbi-section-actions'
- }));
+ }, (actionsTitle !== undefined) ? actionsTitle : null));
+ }
trEls.appendChild(trEl);
}