Browse Source

added links to the example

Dustin Utecht 6 years ago
parent
commit
c9ad0dd1fe
2 changed files with 58 additions and 13 deletions
  1. 57 12
      site/docs/api/column-options.md
  2. 1 1
      tools/check-api.js

+ 57 - 12
site/docs/api/column-options.md

@@ -20,6 +20,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [Field](https://examples.bootstrap-table.com/#column-options/field.html)
+
 ## title
 
 - **Attribute:** `data-title`
@@ -32,6 +34,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [Title](https://examples.bootstrap-table.com/#column-options/title.html)
+
 ## titleTooltip
 
 - **Attribute:** `data-title-tooltip`
@@ -44,6 +48,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [Title (Tooltip)](https://examples.bootstrap-table.com/#column-options/title-tooltip.html)
+
 ## class
 
 - **Attribute:** `class | data-class`
@@ -56,6 +62,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [Classes](https://examples.bootstrap-table.com/#column-options/classes.html)
+
 ## width
 
 - **Attribute:** `data-width`
@@ -68,6 +76,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [Width](https://examples.bootstrap-table.com/#column-options/width.html)
+
 ## widthUnit
 
 - **Attribute:** `data-width-unit`
@@ -80,6 +90,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `px`
 
+- **Example:** [Width](https://examples.bootstrap-table.com/#column-options/width-unit.html)
+
 ## rowspan
 
 - **Attribute:** `rowspan | data-rowspan`
@@ -92,6 +104,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [row span](https://examples.bootstrap-table.com/#column-options/row-span.html)
+
 ## colspan
 
 - **Attribute:** `colspan | data-colspan`
@@ -104,6 +118,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [col span](https://examples.bootstrap-table.com/#column-options/col-span.html)
+
 ## align
 
 - **Attribute:** `data-align`
@@ -116,6 +132,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [column align](https://examples.bootstrap-table.com/#column-options/aligning-columns.html)
+
 ## halign
 
 - **Attribute:** `data-halign`
@@ -128,6 +146,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [H Align](https://examples.bootstrap-table.com/#column-options/aligning-columns.html)
+
 ## falign
 
 - **Attribute:** `data-falign`
@@ -140,6 +160,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [footer align](https://examples.bootstrap-table.com/#column-options/aligning-footer.html)
+
 ## valign
 
 - **Attribute:** `data-valign`
@@ -152,6 +174,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [footer align](https://examples.bootstrap-table.com/#column-options/aligning-columns.html)
+
 ## cellStyle
 
 - **Attribute:** `data-cell-style`
@@ -171,6 +195,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [cell style](https://examples.bootstrap-table.com/#column-options/cell-style.html)
+
 ## radio
 
 - **Attribute:** `data-radio`
@@ -186,6 +212,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `false`
 
+- **Example:** [radio](https://examples.bootstrap-table.com/#column-options/radio.html)
+
 ## checkbox
 
 - **Attribute:** `data-checkbox`
@@ -201,6 +229,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `false`
 
+- **Example:** [checkbox](https://examples.bootstrap-table.com/#column-options/checkbox.html)
+
 ## checkboxEnabled
 
 - **Attribute:** `data-checkbox-enabled`
@@ -213,17 +243,9 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `true`
 
-## clickToSelect
-
-- **Attribute:** `data-click-to-select`
-
-- **Type:** `Boolean`
-
-- **Detail:**
+- **Example:** [checkbox enabled](https://examples.bootstrap-table.com/#column-options/checkbox-enabled.html)
 
-  Set `true` to select checkbox or radio when the column is clicked.
-
-- **Default:** `true`
+## clickToSelect
 
 ## showSelectTitle
 
@@ -237,6 +259,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `false`
 
+- **Example:** [Show title](https://examples.bootstrap-table.com/#column-options/show-select-title.html)
+
 ## sortable
 
 - **Attribute:** `data-sortable`
@@ -249,6 +273,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `false`
 
+- **Example:** [Sortable](https://examples.bootstrap-table.com/#column-options/sortable.html)
+
 ## sortName
 
 - **Attribute:** `data-sort-name`
@@ -261,6 +287,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [Sort name](https://examples.bootstrap-table.com/#column-options/sort-name.html)
+
 ## order
 
 - **Attribute:** `data-order`
@@ -273,6 +301,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `'asc'`
 
+- **Example:** [Sort order](https://examples.bootstrap-table.com/#column-options/sort-order.html)
+
 ## sorter
 
 - **Attribute:** `data-sorter`
@@ -283,8 +313,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
   The custom field sort function that used to do local sorting, take four parameters:
 
-  * `a`: the first field value.
-  * `b`: the second field value.
+  * `fieldA`: the first field value.
+  * `fieldB`: the second field value.
   * `rowA`: the first row.
   * `rowB`: the second row.
 
@@ -302,6 +332,9 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `true`
 
+
+- **Example:** [visible](https://examples.bootstrap-table.com/#column-options/visible.html)
+
 ## switchable
 
 - **Attribute:** `data-switchable`
@@ -326,6 +359,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `true`
 
+- **Example:** [visible](https://examples.bootstrap-table.com/#column-options/card-visible.html)
+
 ## searchable
 
 - **Attribute:** `data-searchable`
@@ -338,6 +373,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `true`
 
+- **Example:** [searchable](https://examples.bootstrap-table.com/#column-options/searchable.html)
+
 ## formatter
 
 - **Attribute:** `data-formatter`
@@ -357,6 +394,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [formatter](https://examples.bootstrap-table.com/#column-options/format.html)
+
 ## footerFormatter
 
 - **Attribute:** `data-footer-formatter`
@@ -375,6 +414,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `undefined`
 
+- **Example:** [footer formatter](https://examples.bootstrap-table.com/#column-options/format-footer.html)
+
 ## detailFormatter
 
 - **Attribute:** `data-detail-formatter`
@@ -401,6 +442,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `true`
 
+- **Example:** [search formatter](https://examples.bootstrap-table.com/#column-options/format-search.html)
+
 ## escape
 
 - **Attribute:** `data-escape`
@@ -413,6 +456,8 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `false`
 
+- **Example:** [escape](https://examples.bootstrap-table.com/#column-options/escape.html)
+
 ## events
 
 - **Attribute:** `data-events`

+ 1 - 1
tools/check-api.js

@@ -68,7 +68,7 @@ class ColumnOptions extends API {
   init () {
     this.file = 'column-options.md'
     this.options = Object.keys(Constants.COLUMN_DEFAULTS)
-    this.attributes = ['Attribute', 'Type', 'Detail', 'Default']// , 'Example']
+    this.attributes = ['Attribute', 'Type', 'Detail', 'Default' , 'Example']
   }
 }