Skip to content

Commit

Permalink
fix #380
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Apr 1, 2016
1 parent cf28f8f commit 61b60d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
7 changes: 5 additions & 2 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ class BootstrapTable extends Component {
columns={ columns }
searchPlaceholder={ this.props.searchPlaceholder }
exportCSVText={ this.props.options.exportCSVText }
ignoreEditable={ this.props.options.ignoreEditable }
onAddRow={ this.handleAddRow }
onDropRow={ this.handleDropRow }
onSearch={ this.handleSearch }
Expand Down Expand Up @@ -801,7 +802,8 @@ BootstrapTable.propTypes = {
firstPage: PropTypes.string,
lastPage: PropTypes.string,
searchDelayTime: PropTypes.number,
exportCSVText: PropTypes.text
exportCSVText: PropTypes.text,
ignoreEditable: PropTypes.bool
}),
fetchInfo: PropTypes.shape({
dataTotalSize: PropTypes.number
Expand Down Expand Up @@ -868,7 +870,8 @@ BootstrapTable.defaultProps = {
firstPage: Const.FIRST_PAGE,
lastPage: Const.LAST_PAGE,
searchDelayTime: undefined,
exportCSVText: Const.EXPORT_CSV_TEXT
exportCSVText: Const.EXPORT_CSV_TEXT,
ignoreEditable: false
},
fetchInfo: {
dataTotalSize: 0
Expand Down
4 changes: 2 additions & 2 deletions src/Editor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

const editor = function(editable, attr, format, editorClass, defaultValue) {
if (editable === true || typeof editable === 'string') { // simple declare
const editor = function(editable, attr, format, editorClass, defaultValue, ignoreEditable) {
if (editable === true || ignoreEditable || typeof editable === 'string') { // simple declare
const type = editable ? 'text' : editable;
return (
<input { ...attr } type={ type } defaultValue={ defaultValue }
Expand Down
10 changes: 6 additions & 4 deletions src/toolbar/ToolBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class ToolBar extends Component {
renderInsertRowModal() {
const validateState = this.state.validateState || {};
const shakeEditor = this.state.shakeEditor;
const inputField = this.props.columns.map(function(column, i) {
const inputField = this.props.columns.map((column, i) => {
const { editable, format, field, name, autoValue } = column;
const attr = {
ref: field + i,
Expand All @@ -311,7 +311,7 @@ class ToolBar extends Component {
return (
<div className='form-group' key={ field }>
<label>{ name }</label>
{ editor(editable, attr, format, '') }
{ editor(editable, attr, format, '', undefined, this.props.ignoreEditable) }
{ error }
</div>
);
Expand Down Expand Up @@ -372,15 +372,17 @@ ToolBar.propTypes = {
columns: PropTypes.array,
searchPlaceholder: PropTypes.string,
exportCSVText: PropTypes.string,
clearSearch: PropTypes.bool
clearSearch: PropTypes.bool,
ignoreEditable: PropTypes.bool
};

ToolBar.defaultProps = {
enableInsert: false,
enableDelete: false,
enableSearch: false,
enableShowOnlySelected: false,
clearSearch: false
clearSearch: false,
ignoreEditable: false
};

export default ToolBar;

0 comments on commit 61b60d1

Please sign in to comment.