From bc910edee414d1e0968681f336d338bf971ecbd4 Mon Sep 17 00:00:00 2001 From: Chun-MingChen Date: Thu, 5 Apr 2018 15:54:06 +0800 Subject: [PATCH] simplify the introduction of column.filter in table-props. * re-position and description in more details in filter-props --- docs/table-props.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/table-props.md b/docs/table-props.md index 72cd9a0..eb26e59 100644 --- a/docs/table-props.md +++ b/docs/table-props.md @@ -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' -} ]; - + text: 'Product Price', + filter: textFilter() // apply text filter +}]; + + ``` ## onTableChange - [Function]