simplify the introduction of column.filter in table-props.

* re-position and description in more details in filter-props
This commit is contained in:
Chun-MingChen 2018-04-05 15:54:06 +08:00
parent 7b4bb40e87
commit bc910edee4

View File

@ -230,30 +230,33 @@ paginationFactory({
```
## filter - [Object]
`filter` allow user to filter data by column. However, filter functionality is separated from core of `react-bootstrap-table2` so that you are suppose to install `react-bootstrap-table2-filter` firstly.
`filter` allows users to filter data by columns. For more information, please navigate to [filter-props](./filter-props.html).
**Getting Started**
```sh
$ npm install react-bootstrap-table2-filter --save
```
After installation of `react-bootstrap-table2-filter`, you can configure filter on table easily:
**Example**
```js
import BootstrapTable from 'react-bootstrap-table-next';
import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
// omit...
const columns = [ {
dataField: 'id',
text: 'Production ID'
const columns = [{
dataField: 'id',
text: 'Product ID'
}, {
dataField: 'name',
text: 'Production Name',
filter: textFilter() // apply text filter
text: 'Product Name'
}, {
dataField: 'price',
text: 'Production Price'
} ];
<BootstrapTable data={ data } columns={ columns } filter={ filterFactory() } />
text: 'Product Price',
filter: textFilter() // apply text filter
}];
<BootstrapTable keyField='id' data={ products } columns={ columns } filter={ filterFactory() } />
```
## onTableChange - [Function]