From f1b39e3dd6805c7e7f882c4114bc7fe8dda52b40 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sun, 20 Jan 2019 17:20:41 +0800 Subject: [PATCH] patch docs for clear search button --- docs/migration.md | 2 +- .../react-bootstrap-table2-toolkit/README.md | 28 ++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/migration.md b/docs/migration.md index 7f5b10d..4f379f8 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -118,7 +118,7 @@ Remember to install [`react-bootstrap-table2-paginator`](https://www.npmjs.com/p - [x] Custom search component and position - [x] Custom search value -- [ ] Clear search +- [x] Clear search - [ ] Multiple search - [ ] Strict search diff --git a/packages/react-bootstrap-table2-toolkit/README.md b/packages/react-bootstrap-table2-toolkit/README.md index bfcce99..dcf7738 100644 --- a/packages/react-bootstrap-table2-toolkit/README.md +++ b/packages/react-bootstrap-table2-toolkit/README.md @@ -95,8 +95,34 @@ If you want to search on the formatted data, you are supposed to enable this pro ``` +### Clear Search Button +We have a built-in clear search function which allow user clear search status via clicking button: + +```js +import ToolkitProvider, { Search } from 'react-bootstrap-table2-toolkit'; + +const { SearchBar, ClearSearchButton } = Search; + + + { + props => ( +
+ + + .... +
+ ) + } +
+``` + ## Export CSV -There are two step to enable the export CSV functionality: +There are two steps to enable the export CSV functionality: 1. Give `exportCSV` prop as `true` on `ToolkitProvider`. 2. Render `ExportCSVButton` with `csvProps`. The position of `ExportCSVButton` is depends on you.