diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index 0b95a258a9..e3f535e2ef 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -608,6 +608,51 @@ class BootstrapTable { this.initBody() } + renderButton (buttonName, buttonConfig) { + let buttonHtml + + if (buttonConfig.hasOwnProperty('html')) { + if (typeof buttonConfig.html === 'function') { + buttonHtml = buttonConfig.html() + } else if (typeof buttonConfig.html === 'string') { + buttonHtml = buttonConfig.html + } + } else { + let buttonClass = this.constants.buttonsClass + + if (buttonConfig.hasOwnProperty('attributes') && buttonConfig.attributes.class) { + buttonClass += ` ${buttonConfig.attributes.class}` + } + buttonHtml = `