mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-07-01 06:30:11 +00:00
20181007 release
This commit is contained in:
@@ -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).
|
||||
@@ -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
51
docs/exposed-api.md
Normal 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`
|
||||
Reference in New Issue
Block a user