浏览代码

Adding logic to add the group row

Dennis Hernández 10 年之前
父节点
当前提交
e73da06301
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/extensions/group-by/bootstrap-table-group-by.js

+ 5 - 1
src/extensions/group-by/bootstrap-table-group-by.js

@@ -69,10 +69,14 @@
         var that = this;
         var that = this;
         //**TESTING**
         //**TESTING**
         this.options.groupByField = 'name';
         this.options.groupByField = 'name';
-        console.log(this.options.data);
         var result = groupBy(this.options.data, function(item) {
         var result = groupBy(this.options.data, function(item) {
             return [item[that.options.groupByField]];
             return [item[that.options.groupByField]];
         });
         });
+
+        for (var i = 0; i < result.length; i++) {
+            result[i].unshift({name: 'Testing'});
+        }
+
         console.log(result);
         console.log(result);
         //**TESTING**
         //**TESTING**
     };
     };