Skip to content

Commit

Permalink
fix #426
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Apr 28, 2016
1 parent 3a95495 commit 0f2e6b7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,8 @@ class BootstrapTable extends Component {
columns={ columns }
searchPlaceholder={ this.props.searchPlaceholder }
exportCSVText={ this.props.options.exportCSVText }
insertText={ this.props.options.insertText }
deleteText={ this.props.options.deleteText }
ignoreEditable={ this.props.options.ignoreEditable }
onAddRow={ this.handleAddRow }
onDropRow={ this.handleDropRow }
Expand Down Expand Up @@ -826,7 +828,9 @@ BootstrapTable.propTypes = {
firstPage: PropTypes.string,
lastPage: PropTypes.string,
searchDelayTime: PropTypes.number,
exportCSVText: PropTypes.text,
exportCSVText: PropTypes.string,
insertText: PropTypes.string,
deleteText: PropTypes.string,
ignoreEditable: PropTypes.bool
}),
fetchInfo: PropTypes.shape({
Expand Down Expand Up @@ -902,6 +906,8 @@ BootstrapTable.defaultProps = {
lastPage: Const.LAST_PAGE,
searchDelayTime: undefined,
exportCSVText: Const.EXPORT_CSV_TEXT,
insertText: Const.INSERT_BTN_TEXT,
deleteText: Const.DELETE_BTN_TEXT,
ignoreEditable: false
},
fetchInfo: {
Expand Down
2 changes: 2 additions & 0 deletions src/Const.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export default {
SHOW_ONLY_SELECT: 'Show Selected Only',
SHOW_ALL: 'Show All',
EXPORT_CSV_TEXT: 'Export to CSV',
INSERT_BTN_TEXT: 'New',
DELETE_BTN_TEXT: 'Delete',
FILTER_DELAY: 500,
FILTER_TYPE: {
TEXT: 'TextFilter',
Expand Down
11 changes: 8 additions & 3 deletions src/toolbar/ToolBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class ToolBar extends Component {
className='btn btn-info react-bs-table-add-btn'
data-toggle='modal'
data-target={ '.' + this.modalClassName }>
<i className='glyphicon glyphicon-plus'></i> New
<i className='glyphicon glyphicon-plus'></i> { this.props.insertText }
</button>
);
}
Expand All @@ -205,7 +205,7 @@ class ToolBar extends Component {
data-placement='right'
title='Drop selected row'
onClick={ this.handleDropRowBtnClick }>
<i className='glyphicon glyphicon-trash'></i> Delete
<i className='glyphicon glyphicon-trash'></i> { this.props.deleteText }
</button>
);
}
Expand Down Expand Up @@ -372,6 +372,8 @@ ToolBar.propTypes = {
columns: PropTypes.array,
searchPlaceholder: PropTypes.string,
exportCSVText: PropTypes.string,
insertText: PropTypes.string,
deleteText: PropTypes.string,
clearSearch: PropTypes.bool,
ignoreEditable: PropTypes.bool
};
Expand All @@ -382,7 +384,10 @@ ToolBar.defaultProps = {
enableSearch: false,
enableShowOnlySelected: false,
clearSearch: false,
ignoreEditable: false
ignoreEditable: false,
exportCSVText: Const.EXPORT_CSV_TEXT,
insertText: Const.INSERT_BTN_TEXT,
deleteText: Const.DELETE_BTN_TEXT
};

export default ToolBar;

0 comments on commit 0f2e6b7

Please sign in to comment.