Skip to content

Commit f6171fa

Browse files
committed
support a custom text on export csv button
1 parent 60a8429 commit f6171fa

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/BootstrapTable.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ class BootstrapTable extends Component {
640640
enableShowOnlySelected={ enableShowOnlySelected }
641641
columns={ columns }
642642
searchPlaceholder={ this.props.searchPlaceholder }
643+
exportCSVText={ this.props.options.exportCSVText }
643644
onAddRow={ this.handleAddRow }
644645
onDropRow={ this.handleDropRow }
645646
onSearch={ this.handleSearch }
@@ -798,7 +799,8 @@ BootstrapTable.propTypes = {
798799
nextPage: PropTypes.string,
799800
firstPage: PropTypes.string,
800801
lastPage: PropTypes.string,
801-
searchDelayTime: PropTypes.number
802+
searchDelayTime: PropTypes.number,
803+
exportCSVText: PropTypes.text
802804
}),
803805
fetchInfo: PropTypes.shape({
804806
dataTotalSize: PropTypes.number
@@ -864,7 +866,8 @@ BootstrapTable.defaultProps = {
864866
nextPage: Const.NEXT_PAGE,
865867
firstPage: Const.FIRST_PAGE,
866868
lastPage: Const.LAST_PAGE,
867-
searchDelayTime: undefined
869+
searchDelayTime: undefined,
870+
exportCSVText: Const.EXPORT_CSV_TEXT
868871
},
869872
fetchInfo: {
870873
dataTotalSize: 0

src/Const.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default {
1818
NO_DATA_TEXT: 'There is no data to display',
1919
SHOW_ONLY_SELECT: 'Show Selected Only',
2020
SHOW_ALL: 'Show All',
21+
EXPORT_CSV_TEXT: 'Export to CSV',
2122
FILTER_DELAY: 500,
2223
FILTER_TYPE: {
2324
TEXT: 'TextFilter',

src/toolbar/ToolBar.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class ToolBar extends Component {
220220
<button type='button'
221221
className='btn btn-success'
222222
onClick={ this.handleExportCSV }>
223-
<i className='glyphicon glyphicon-export'></i> Export to CSV
223+
<i className='glyphicon glyphicon-export'></i>{ this.props.exportCSVText }
224224
</button>
225225
);
226226
}
@@ -364,6 +364,7 @@ ToolBar.propTypes = {
364364
enableShowOnlySelected: PropTypes.bool,
365365
columns: PropTypes.array,
366366
searchPlaceholder: PropTypes.string,
367+
exportCSVText: PropTypes.string,
367368
clearSearch: PropTypes.bool
368369
};
369370

0 commit comments

Comments
 (0)