20181007 release

This commit is contained in:
AllenFang 2018-10-07 13:48:57 +08:00
parent fbf0795aa4
commit 319e8525ea
6 changed files with 98 additions and 1 deletions

View File

@ -79,4 +79,4 @@ There're two way you can change or prettify the header when sorting: [`headerSor
## Custom the Sort Caret
**Coming Soon!**
See [`column.sortCaret`](./column-props.html#columnsortcaret-function).

View File

@ -16,6 +16,7 @@ Definition of columns props on BootstrapTable
* [formatExtraData](#columnformatextradata-any)
* [sort](#columnsort-bool)
* [sortFunc](#columnsortfunc-function)
* [sortCaret](#columnsortcaret-function)
* [onSort](#columnonsort-function)
* [classes](#columnclasses-string-function)
* [style](#columnstyle-object-function)
@ -128,6 +129,19 @@ Enable the column sort via a `true` value given.
```
> The possible value of `order` argument is **`asc`** and **`desc`**.
## column.sortCaret - [Function]
Use`column.sortCaret` to custom the sort caret. This callback function accept two arguments: `order` and `column`
```js
{
// omit...
sort: true,
sortCaret: (order, column) => {
return //...
}
}
```
> The possible value of `order` argument is **`asc`**, **`desc`** and **`undefined`**.
## column.onSort - [Function]
`column.onSort` is an event listener for subscribing the event of sort:

51
docs/exposed-api.md Normal file
View File

@ -0,0 +1,51 @@
---
id: exposed-api
title: Introduction Exposed API
sidebar_label: Introduction
---
`react-bootstrap-table2` support some hooks function that you can use to know what state changes, for example: a row is select or unselect.
In addition, we also allow you use `React` `Refs` to directly access the components so that you can easier to get some table states.
**[Live Demo](../storybook/index.html?selectedKind=Basic%20Table&selectedStory=Exposed%20API)**
## Add a Refs on `BootstrapTable`
```js
<BootstrapTable
ref={ n => this.node = n }
...
/>
```
## Get Current Display Rows
`this.node.table.props.data`
## Get Current Selected Rows
`this.node.selectionContext.state.selected`
## Get Current Expanded Rows
`this.node.rowExpandContext.state.expanded`
## Get Current Page
`this.node.paginationContext.currPage`
## Get Current Size Per Page
`this.node.paginationContext.currSizePerPage`
## Get Current Sorting Column
`this.node.sortContext.state.sortColumn`
## Get Current Sorting Order
`this.node.sortContext.state.sortOrder`
## Get Current Filters
`this.node.filterContext.currFilters`

View File

@ -0,0 +1,26 @@
---
title: New Release (2018-10-07)
author: Allen Fang
authorURL: https://twitter.com/allenfang_tw
---
## Changed Packages
This release bump following packages:
* `react-bootstrap-table-next@1.2.1`
* `react-bootstrap-table2-paginator@1.0.3`
* `react-bootstrap-table2-toolkit@1.1.1`
## Changelog
### Bug fixes
* Fixed remote search bug([#591](https://github.com/react-bootstrap-table/react-bootstrap-table2/pull/591))
* Fixed wrong calculation for `from` and `to` in pagination when remote search/filter enable and data is shrink below the current page([#594](https://github.com/react-bootstrap-table/react-bootstrap-table2/pull/594))
### Features
* Implement `column.sortCaret`([#593](https://github.com/react-bootstrap-table/react-bootstrap-table2/pull/593)) for customing the sort caret
### Enhancements
* Easy to access the exposed API from react `ref`([#592](https://github.com/react-bootstrap-table/react-bootstrap-table2/pull/592))

View File

@ -33,6 +33,8 @@
"cell-edit-props": "Cell Editing Props",
"column-props": "Columns Props",
"export-csv-props": "Export CSV Props",
"exposed-api": "Introduction Exposed API",
"Introduction": "Introduction",
"filter-props": "Column Filter Props",
"getting-started": "Getting Started",
"Getting Started": "Getting Started",
@ -53,6 +55,7 @@
"Basic Usage": "Basic Usage",
"Remote Table": "Remote Table",
"Table Toolkits": "Table Toolkits",
"Exposed API": "Exposed API",
"Table Definition": "Table Definition",
"Column Definition": "Column Definition",
"Cell Editing Definition": "Cell Editing Definition",

View File

@ -24,6 +24,9 @@
"toolkits-getting-started",
"basic-search",
"basic-export-csv"
],
"Exposed API": [
"exposed-api"
]
},
"api": {