浏览代码

Updated tools and docs

zhixin 5 年之前
父节点
当前提交
121c201ae0
共有 4 个文件被更改,包括 72 次插入71 次删除
  1. 25 25
      site/docs/api/column-options.md
  2. 12 12
      site/docs/api/localizations.md
  3. 34 33
      site/docs/api/table-options.md
  4. 1 1
      tools/check-api.js

+ 25 - 25
site/docs/api/column-options.md

@@ -231,7 +231,7 @@ 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`
@@ -318,39 +318,39 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Example:** [Rowspan Colspan](https://examples.bootstrap-table.com/#column-options/rowspan-colspan.html)
 
-## searchFormatter
+## searchable
 
-- **Attribute:** `data-search-formatter`
+- **Attribute:** `data-searchable`
 
 - **Type:** `Boolean`
 
 - **Detail:**
 
-  Set `true` to search use formatted data.
+  Set `true` to search data for this column.
 
 - **Default:** `true`
 
-- **Example:** [Search Formatter](https://examples.bootstrap-table.com/#column-options/search-formatter.html)
+- **Example:** [Column Searchable](https://examples.bootstrap-table.com/#column-options/searchable.html)
 
-## searchable
+## searchFormatter
 
-- **Attribute:** `data-searchable`
+- **Attribute:** `data-search-formatter`
 
 - **Type:** `Boolean`
 
 - **Detail:**
 
-  Set `true` to search data for this column.
+  Set `true` to search use formatted data.
 
 - **Default:** `true`
 
-- **Example:** [Column Searchable](https://examples.bootstrap-table.com/#column-options/searchable.html)
+- **Example:** [Search Formatter](https://examples.bootstrap-table.com/#column-options/search-formatter.html)
 
 ## searchHighlightFormatter
 
 - **Attribute:** `data-search-highlight-formatter`
 
-- **Type:** `Function|Bool`
+- **Type:** `Boolean|Function`
 
 - **Detail:**
 
@@ -358,7 +358,7 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Default:** `true`
 
-- **Example:** [Column Searchable](https://examples.bootstrap-table.com/#column-options/search-highlight-formatter.html)
+- **Example:** [Searchable Highlight Formatter](https://examples.bootstrap-table.com/#column-options/search-highlight-formatter.html)
 
 ## showSelectTitle
 
@@ -374,20 +374,6 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Example:** [Show Select Title](https://examples.bootstrap-table.com/#column-options/show-select-title.html)
 
-## sortName
-
-- **Attribute:** `data-sort-name`
-
-- **Type:** `String`
-
-- **Detail:**
-
-  Provide a customizable sort-name, not the default sort-name in the header, or the field name of the column. For example, a column might display the value of fieldName of 'html' such as `<b><span style="color:red">abc</span></b>`, but a fieldName to sort is 'content' with the value of `'abc'`.
-
-- **Default:** `undefined`
-
-- **Example:** [Sort Name Order](https://examples.bootstrap-table.com/#column-options/sort-name-order.html)
-
 ## sortable
 
 - **Attribute:** `data-sortable`
@@ -423,6 +409,20 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
 
 - **Example:** [Column Sorter](https://examples.bootstrap-table.com/#column-options/sorter.html)
 
+## sortName
+
+- **Attribute:** `data-sort-name`
+
+- **Type:** `String`
+
+- **Detail:**
+
+  Provide a customizable sort-name, not the default sort-name in the header, or the field name of the column. For example, a column might display the value of fieldName of 'html' such as `<b><span style="color:red">abc</span></b>`, but a fieldName to sort is 'content' with the value of `'abc'`.
+
+- **Default:** `undefined`
+
+- **Example:** [Sort Name Order](https://examples.bootstrap-table.com/#column-options/sort-name-order.html)
+
 ## switchable
 
 - **Attribute:** `data-switchable`

+ 12 - 12
site/docs/api/localizations.md

@@ -125,6 +125,18 @@ $('#table').bootstrapTable({
 
 - **Default:** `'Refresh'`
 
+## formatSearch
+
+- **Parameter:** `undefined`
+
+- **Default:** `'Search'`
+
+## formatShowingRows
+
+- **Parameter:** `pageFrom, pageTo, totalRows`
+
+- **Default:** `'Showing %s to %s of %s rows'`
+
 ## formatSRPaginationNextText
 
 - **Parameter:** `undefined`
@@ -143,18 +155,6 @@ $('#table').bootstrapTable({
 
 - **Default:** `'previous page'`
 
-## formatSearch
-
-- **Parameter:** `undefined`
-
-- **Default:** `'Search'`
-
-## formatShowingRows
-
-- **Parameter:** `pageFrom, pageTo, totalRows`
-
-- **Default:** `'Showing %s to %s of %s rows'`
-
 ## formatToggle
 
 - **Parameter:** `undefined`

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

@@ -452,7 +452,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
   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": [
@@ -543,20 +543,6 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Example:** [Table Height](https://examples.bootstrap-table.com/#options/table-height.html)
 
-## iconSize
-
-- **Attribute:** `data-icon-size`
-
-- **Type:** `String`
-
-- **Detail:**
-
-  Defines icon size, `undefined`, `'lg'`, `'sm'` can be used.
-
-- **Default:** `undefined`
-
-- **Example:** [Icon Size](https://examples.bootstrap-table.com/#options/icon-size.html)
-
 ## icons
 
 - **Attribute:** `data-icons`
@@ -585,6 +571,20 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Example:** [Table Icons](https://examples.bootstrap-table.com/#options/table-icons.html)
 
+## iconSize
+
+- **Attribute:** `data-icon-size`
+
+- **Type:** `String`
+
+- **Detail:**
+
+  Defines icon size, `undefined`, `'lg'`, `'sm'` can be used.
+
+- **Default:** `undefined`
+
+- **Example:** [Icon Size](https://examples.bootstrap-table.com/#options/icon-size.html)
+
 ## iconsPrefix
 
 - **Attribute:** `data-icons-prefix`
@@ -1075,7 +1075,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Example:** [Table Search](https://examples.bootstrap-table.com/#options/table-search.html)
 
-### searchAccentNeutralise
+## searchAccentNeutralise
 
 - **Attribute:** `data-search-accent-neutralise`
 
@@ -1111,11 +1111,12 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Detail:**
 
-  Set to `true` to highlight the searched text (using the `<mark>` html tag).   
-  You can also define a [custom highlight formatter](https://bootstrap-table.com/docs/api/column-options/#searchhighlightformatter) e.g. for values with html or to use a custom highlight color. 
+  Set to `true` to highlight the searched text (using the `<mark>` html tag).
+  You can also define a [custom highlight formatter](https://bootstrap-table.com/docs/api/column-options/#searchhighlightformatter) e.g. for values with html or to use a custom highlight color.
+
 - **Default:** `'false'`
 
-- **Example:** [Search Align](https://examples.bootstrap-table.com/#options/search-highlight.html)
+- **Example:** [Search Highlight](https://examples.bootstrap-table.com/#options/search-highlight.html)
 
 ## searchOnEnterKey
 
@@ -1447,6 +1448,20 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Example:** [Smart Display](https://examples.bootstrap-table.com/#options/smart-display.html)
 
+## sortable
+
+- **Attribute:** `data-sortable`
+
+- **Type:** `Boolean`
+
+- **Detail:**
+
+  Set `false` to disable sortable of all columns.
+
+- **Default:** `true`
+
+- **Example:** [Table Sortable](https://examples.bootstrap-table.com/#options/table-sortable.html)
+
 ## sortClass
 
 - **Attribute:** `data-sort-class`
@@ -1517,20 +1532,6 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 - **Example:** [Sort Stable](https://examples.bootstrap-table.com/#options/sort-stable.html)
 
-## sortable
-
-- **Attribute:** `data-sortable`
-
-- **Type:** `Boolean`
-
-- **Detail:**
-
-  Set `false` to disable sortable of all columns.
-
-- **Default:** `true`
-
-- **Example:** [Table Sortable](https://examples.bootstrap-table.com/#options/table-sortable.html)
-
 ## strictSearch
 
 - **Attribute:** `data-strict-search`

+ 1 - 1
tools/check-api.js

@@ -27,7 +27,7 @@ class API {
   }
 
   sortOptions () {
-    this.options.sort()
+    this.options.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))
   }
 
   check () {