Skip to content

Commit

Permalink
support a custom text on export csv button
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Mar 26, 2016
1 parent 60a8429 commit f6171fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Const.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion src/toolbar/ToolBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class ToolBar extends Component {
<button type='button'
className='btn btn-success'
onClick={ this.handleExportCSV }>
<i className='glyphicon glyphicon-export'></i> Export to CSV
<i className='glyphicon glyphicon-export'></i>{ this.props.exportCSVText }
</button>
);
}
Expand Down Expand Up @@ -364,6 +364,7 @@ ToolBar.propTypes = {
enableShowOnlySelected: PropTypes.bool,
columns: PropTypes.array,
searchPlaceholder: PropTypes.string,
exportCSVText: PropTypes.string,
clearSearch: PropTypes.bool
};

Expand Down

0 comments on commit f6171fa

Please sign in to comment.