浏览代码

Add examples link

zhixin 6 年之前
父节点
当前提交
bb1dfa2272
共有 1 个文件被更改,包括 74 次插入54 次删除
  1. 74 54
      site/docs/api/table-options.md

+ 74 - 54
site/docs/api/table-options.md

@@ -972,6 +972,8 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Default:** `true`
 
+- **Example:** [Smart Display](https://examples.bootstrap-table.com/#options/smart-display.html)
+
 ## escape
 
 - **Attribute:** `data-escape`
@@ -984,6 +986,8 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Default:** `false`
 
+- **Example:** [Table Escape](https://examples.bootstrap-table.com/#options/table-escape.html)
+
 ## idField
 
 - **Attribute:** `data-id-field`
@@ -996,141 +1000,157 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Default:** `undefined`
 
-## uniqueId
+- **Example:** [Id Field](https://examples.bootstrap-table.com/#options/id-field.html)
 
-- **Attribute:** `data-unique-id`
+## selectItemName
+
+- **Attribute:** `data-select-item-name`
 
 - **Type:** `String`
 
 - **Detail:**
 
-  Indicate an unique identifier for each row.
+  The name of radio or checkbox input.
 
-- **Default:** `undefined`
+- **Default:** `'btSelectItem'`
 
-## cardView
+- **Example:** [Id Field](https://examples.bootstrap-table.com/#options/id-field.html)
 
-- **Attribute:** `data-card-view`
+## clickToSelect
+
+- **Attribute:** `data-click-to-select`
 
 - **Type:** `Boolean`
 
 - **Detail:**
 
-  Set `true` to show card view table, for example mobile view.
+  Set `true` to select checkbox or radiobox when clicking rows.
 
 - **Default:** `false`
 
-## detailView
-
-- **Attribute:** `data-detail-view`
-
-- **Type:** `Boolean`
+- **Example:** [Click To Select](https://examples.bootstrap-table.com/#options/click-to-select.html)
 
-- **Detail:**
+## ignoreClickToSelectOn
 
-  Set `true` to show detail view table.
+- **Attribute:** `data-ignore-click-to-select-on`
 
-- **Default:** `false`
+- **Type:** `Function`
 
-## detailFormatter
+- **Detail:**
 
-- **Attribute:** `data-detail-formatter`
+  Set the ignore elements `clickToSelect` on. Takes one parameter:
 
-- **Type:** `Function`
+  * `element`: the element clicked on.
 
-- **Detail:**
+  Return true if the click should be ignored, false if the click should cause the row to be selected. This option is only relevant if `clickToSelect` is true.
 
-  Format your detail view when detailView is set to true. Return a String and it will be appended into the detail view cell, optionally render the element directly using the third parameter which is a jQuery element of the target cell.
+- **Default:** `{ return ['A', 'BUTTON'].includes(tagName) }`
 
-- **Default:** `function(index, row, element) { return '' }`
+- **Example:** [Ignore Click To Select On](https://examples.bootstrap-table.com/#options/ignore-click-to-select-on.html)
 
-## detailFilter
+## singleSelect
 
-- **Attribute:** `data-detail-filter`
+- **Attribute:** `data-single-select`
 
-- **Type:** `Function`
+- **Type:** `Boolean`
 
 - **Detail:**
 
-  Enable expansion per row when detailView is set to true. Return true and the row will be enabled for expansion, return false and expansion for the row will be disabled. Default function returns true to enable expansion for all rows.
+  Set `true` to allow checkbox selecting only one row.
 
-- **Default:** `function(index, row) { return true }`
+- **Default:** `false`
 
-## selectItemName
+- **Example:** [Single Select](https://examples.bootstrap-table.com/#options/single-select.html)
 
-- **Attribute:** `data-select-item-name`
+## checkboxHeader
 
-- **Type:** `String`
+- **Attribute:** `data-checkbox-header`
+
+- **Type:** `Boolean`
 
 - **Detail:**
 
-  The name of radio or checkbox input.
+  Set `false` to hide check-all checkbox in header row.
 
-- **Default:** `'btSelectItem'`
+- **Default:** `true`
 
-## clickToSelect
+- **Example:** [Checkbox Header](https://examples.bootstrap-table.com/#options/checkbox-header.html)
 
-- **Attribute:** `data-click-to-select`
+## maintainSelected
+
+- **Attribute:** `data-maintain-selected`
 
 - **Type:** `Boolean`
 
 - **Detail:**
 
-  Set `true` to select checkbox or radiobox when clicking rows.
+  Set `true` to maintain selected rows on change page and search.
 
 - **Default:** `false`
 
-## ignoreClickToSelectOn
+- **Example:** [Maintain Selected](https://examples.bootstrap-table.com/#options/maintain-selected.html)
 
-- **Attribute:** `data-ignore-click-to-select-on`
+## uniqueId
 
-- **Type:** `Function`
+- **Attribute:** `data-unique-id`
 
-- **Detail:**
+- **Type:** `String`
 
-  Takes one parameters:
+- **Detail:**
 
-  * `element`: the element clicked on.
+  Indicate an unique identifier for each row.
 
-  Return true if the click should be ignored, false if the click should cause the row to be selected. This option is only relevant if clickToSelect is true.
+- **Default:** `undefined`
 
-- **Default:** `{ return $.inArray(element.tagName, ['A', 'BUTTON']) }`
+- **Example:** [getRowByUniqueId](https://examples.bootstrap-table.com/#methods/getRowByUniqueId.html)
 
-## singleSelect
+## cardView
 
-- **Attribute:** `data-single-select`
+- **Attribute:** `data-card-view`
 
 - **Type:** `Boolean`
 
 - **Detail:**
 
-  Set `true` to allow checkbox selecting only one row.
+  Set `true` to show card view table, for example mobile view.
 
 - **Default:** `false`
 
-## checkboxHeader
+## detailView
 
-- **Attribute:** `data-checkbox-header`
+- **Attribute:** `data-detail-view`
 
 - **Type:** `Boolean`
 
 - **Detail:**
 
-  Set `false` to hide check-all checkbox in header row.
+  Set `true` to show detail view table.
 
-- **Default:** `true`
+- **Default:** `false`
 
-## maintainSelected
+## detailFormatter
 
-- **Attribute:** `data-maintain-selected`
+- **Attribute:** `data-detail-formatter`
 
-- **Type:** `Boolean`
+- **Type:** `Function`
 
 - **Detail:**
 
-  Set `true` to maintain selected rows on change page and search.
+  Format your detail view when detailView is set to true. Return a String and it will be appended into the detail view cell, optionally render the element directly using the third parameter which is a jQuery element of the target cell.
 
-- **Default:** `false`
+- **Default:** `function(index, row, element) { return '' }`
+
+## detailFilter
+
+- **Attribute:** `data-detail-filter`
+
+- **Type:** `Function`
+
+- **Detail:**
+
+  Enable expansion per row when detailView is set to true. Return true and the row will be enabled for expansion, return false and expansion for the row will be disabled. Default function returns true to enable expansion for all rows.
+
+- **Default:** `function(index, row) { return true }`
 
 ## toolbar