Browse Source

Support buttons.xyz.attributes.class

Marcel Overdijk 2 years ago
parent
commit
044c892d1c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/bootstrap-table.js

+ 5 - 1
src/bootstrap-table.js

@@ -746,7 +746,11 @@ class BootstrapTable {
           buttonHtml = buttonConfig.html
         }
       } else {
-        buttonHtml = `<button class="${this.constants.buttonsClass}" type="button" name="${buttonName}"`
+        if (buttonConfig.hasOwnProperty('attributes')) {
+          let buttonClass = buttonConfig.attributes.class || ''
+        }
+        buttonClass += ` ${this.constants.buttonsClass}`
+        buttonHtml = `<button class="${buttonClass}" type="button" name="${buttonName}"`
 
         if (buttonConfig.hasOwnProperty('attributes')) {
           for (const [attributeName, value] of Object.entries(buttonConfig.attributes)) {