浏览代码

Added documentation for the footer field

Dustin Utecht 5 年之前
父节点
当前提交
c12d26be67
共有 2 个文件被更改,包括 35 次插入0 次删除
  1. 2 0
      site/docs/api/column-options.md
  2. 33 0
      site/docs/api/table-options.md

+ 2 - 0
site/docs/api/column-options.md

@@ -231,6 +231,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
   * `value`: If footer data is set, the value of the footer column.
 
   the function should return a string with the text to show in the footer cell.
+  
+  If you fetch data from a server and tries to set the footer value from the server response, please use the `footerField` Option.
 
 - **Default:** `undefined`
 

+ 33 - 0
site/docs/api/table-options.md

@@ -442,6 +442,39 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Example:** [Filter Options](https://examples.bootstrap-table.com/#options/filter-options.html)
 
+## footerField
+
+- **Attribute:** `data-footer-field`
+
+- **Type:** `String`
+
+- **Detail:**
+
+  Defines the key of the footer Object (From data array or server response json).
+  The footer Object can be used to set/define footer colspans and/or the value of the footer.
+  
+  {% highlight javascript %}
+    {
+      "rows": [
+        {
+          "id": 0,
+          "name": "Item 0",
+          "price": "$0",
+          "amount": 3
+        }
+      ],
+      "footer": {
+        "id": "footer id",
+        "_id_colspan": 2,
+        "name": "footer name"
+      }
+    }
+    {% endhighlight %}
+
+- **Default:** `footerField`
+
+- **Example:** [Footer Field](https://examples.bootstrap-table.com/#options/footer-field.html)
+
 ## footerStyle
 
 - **Attribute:** `data-footer-style`