浏览代码

add extension.json, fix detailView column

y.slobodnuk 10 年之前
父节点
当前提交
5b3c8062ea
共有 2 个文件被更改,包括 21 次插入1 次删除
  1. 9 1
      src/extensions/group-by-v2/bootstrap-table-group-by.js
  2. 12 0
      src/extensions/group-by-v2/extension.json

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

@@ -103,16 +103,24 @@
                     checkBox = true;
                 } else {
                     if (column.visible) {
-                        visibleColumns++;
+                        visibleColumns += 1;
                     }
                 }
             });
 
+            if (this.options.detailView && !this.options.cardView) {
+                visibleColumns += 1;
+            }
+
             tableGroups.forEach(function(item){
                 var html = [];
 
                 html.push(sprintf('<tr class="info groupBy expanded" data-group-index="%s">', item.id));
 
+                if (that.options.detailView && !that.options.cardView) {
+                    html.push('<td class="detail"></td>');
+                }
+
                 if (checkBox) {
                     html.push('<td class="bs-checkbox">',
                         '<input name="btSelectGroup" type="checkbox" />',

+ 12 - 0
src/extensions/group-by-v2/extension.json

@@ -0,0 +1,12 @@
+{
+  "name": "Group By",
+  "version": "1.0.0",
+  "description": "Group the data by field",
+  "url": "https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/group-by-v2",
+  "example": "",
+  "plugins": [],
+  "author": {
+    "name": "Knoxvillekm",
+    "image": "https://avatars3.githubusercontent.com/u/11072464"
+  }
+}