mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
simplify the introduction of column.filter in table-props.
* re-position and description in more details in filter-props
This commit is contained in:
parent
7b4bb40e87
commit
bc910edee4
@ -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]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user