From f6171fae78fd7cad17ea123c024f486efcf126e3 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sat, 26 Mar 2016 13:48:38 +0800 Subject: [PATCH] support a custom text on export csv button --- src/BootstrapTable.js | 7 +++++-- src/Const.js | 1 + src/toolbar/ToolBar.js | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/BootstrapTable.js b/src/BootstrapTable.js index 463503b07..bcd0453c9 100644 --- a/src/BootstrapTable.js +++ b/src/BootstrapTable.js @@ -640,6 +640,7 @@ class BootstrapTable extends Component { enableShowOnlySelected={ enableShowOnlySelected } columns={ columns } searchPlaceholder={ this.props.searchPlaceholder } + exportCSVText={ this.props.options.exportCSVText } onAddRow={ this.handleAddRow } onDropRow={ this.handleDropRow } onSearch={ this.handleSearch } @@ -798,7 +799,8 @@ BootstrapTable.propTypes = { nextPage: PropTypes.string, firstPage: PropTypes.string, lastPage: PropTypes.string, - searchDelayTime: PropTypes.number + searchDelayTime: PropTypes.number, + exportCSVText: PropTypes.text }), fetchInfo: PropTypes.shape({ dataTotalSize: PropTypes.number @@ -864,7 +866,8 @@ BootstrapTable.defaultProps = { nextPage: Const.NEXT_PAGE, firstPage: Const.FIRST_PAGE, lastPage: Const.LAST_PAGE, - searchDelayTime: undefined + searchDelayTime: undefined, + exportCSVText: Const.EXPORT_CSV_TEXT }, fetchInfo: { dataTotalSize: 0 diff --git a/src/Const.js b/src/Const.js index 8d374689f..008e57192 100644 --- a/src/Const.js +++ b/src/Const.js @@ -18,6 +18,7 @@ export default { NO_DATA_TEXT: 'There is no data to display', SHOW_ONLY_SELECT: 'Show Selected Only', SHOW_ALL: 'Show All', + EXPORT_CSV_TEXT: 'Export to CSV', FILTER_DELAY: 500, FILTER_TYPE: { TEXT: 'TextFilter', diff --git a/src/toolbar/ToolBar.js b/src/toolbar/ToolBar.js index aded45d5a..07f458849 100644 --- a/src/toolbar/ToolBar.js +++ b/src/toolbar/ToolBar.js @@ -220,7 +220,7 @@ class ToolBar extends Component { ); } @@ -364,6 +364,7 @@ ToolBar.propTypes = { enableShowOnlySelected: PropTypes.bool, columns: PropTypes.array, searchPlaceholder: PropTypes.string, + exportCSVText: PropTypes.string, clearSearch: PropTypes.bool };