Browse Source

fixed groupByFormatter not being called due to invalid option type

Szymon Sobczyk 5 years ago
parent
commit
800a1d4f4a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/extensions/group-by-v2/bootstrap-table-group-by.js

+ 2 - 2
src/extensions/group-by-v2/bootstrap-table-group-by.js

@@ -152,8 +152,8 @@ BootstrapTable.prototype.initBody = function (...args) {
 
       let formattedValue = item.name
 
-      if (typeof (that.options.groupByFormatter) === 'function') {
-        formattedValue = that.options.groupByFormatter(item.name, item.id, item.data)
+      if (!(that.options.groupByFormatter) === undefined) {
+        formattedValue = Utils.calculateObjectValue(item, that.options.groupByFormatter, [item.name, item.id, item.data])
       }
       html.push('<td',
         Utils.sprintf(' colspan="%s"', visibleColumns),