react-bootstrap-table icon indicating copy to clipboard operation
react-bootstrap-table copied to clipboard

Allow changing the clear search button text

Open Rclass93 opened this issue 9 years ago • 3 comments

Hey! I know you can change the text of the create, delete and other buttons, but the button for clearing search cannot be changed. Are you going to allow that in the future? Thank you!

Rclass93 avatar Oct 19 '17 09:10 Rclass93

You already can :)

In the BootstrapTable Options, there is an option called "clearSearchBtn" that takes a function that lets you create your own clear search button. The function takes a single parameter, which is the "onClick" handler function to use when the clear search button is clicked. The normal ClearSearchButton component is exported so that you can use it to create a custom version - with your desired text.

See the example: https://github.com/AllenFang/react-bootstrap-table/blob/master/examples/js/custom/search/default-custom-search-clear-button.js

You can simply pass the "onClick" parameter straight into the ClearSearchButton component's onClick property if you don't need to do anything else prior to the normal onClick function firing.

dawnmist avatar Oct 21 '17 04:10 dawnmist

thanks @dawnmist 👍 👍

AllenFang avatar Oct 23 '17 08:10 AllenFang

Thank you!!

Rclass93 avatar Oct 23 '17 10:10 Rclass93