Browse Source

Fix #6264

Group by extension can work with complex objects rather than just primitive types
adam.johnson 3 years ago
parent
commit
ade73e5e18
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/extensions/group-by-v2/bootstrap-table-group-by.js

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

@@ -83,8 +83,9 @@ BootstrapTable.prototype.initSort = function (...args) {
       const groupByFields = this.getGroupByFields()
       const groupValues = []
 
-      $.each(groupByFields, (i, field) => {
-        groupValues.push(item[field])
+    $.each(groupByFields, (i, field) => {
+        let value_ = Utils.getItemField(item, field, that.options.escape, item.escape)
+        groupValues.push(value_)
       })
 
       return groupValues.join(', ')