Skip to content

Commit

Permalink
fix #1478, use editTdAttr to add attribute to TD when cell editing
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Jul 29, 2017
1 parent 249b1ef commit 42e84b7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class BootstrapTable extends Component {
export: column.props.export,
expandable: column.props.expandable,
attrs: column.props.tdAttr,
editAttrs: column.props.editTdAttr,
style: column.props.tdStyle
};

Expand Down
1 change: 1 addition & 0 deletions src/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class TableBody extends Component {
completeEdit={ this.handleCompleteEditCell }
// add by bluespring for column editor customize
editable={ editable }
attrs={ column.editAttrs }
customEditor={ column.customEditor }
format={ column.format ? format : false }
key={ i }
Expand Down
5 changes: 4 additions & 1 deletion src/TableEditColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ class TableEditColumn extends Component {
customEditor,
isFocus,
customStyleWithNav,
row
row,
attrs
} = this.props;
const { shakeEditor } = this.state;
const attr = {
Expand Down Expand Up @@ -241,6 +242,7 @@ class TableEditColumn extends Component {

return (
<td ref='td'
{ ...attrs }
style={ style }
className={ className }
onClick={ this.handleClick }>
Expand Down Expand Up @@ -275,6 +277,7 @@ TableEditColumn.propTypes = {
className: PropTypes.any,
beforeShowError: PropTypes.func,
isFocus: PropTypes.bool,
attrs: PropTypes.object,
customStyleWithNav: PropTypes.oneOfType([ PropTypes.func, PropTypes.object ])
};

Expand Down
2 changes: 2 additions & 0 deletions src/TableHeaderColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ TableHeaderColumn.propTypes = {
export: PropTypes.bool,
expandable: PropTypes.bool,
tdAttr: PropTypes.object,
editTdAttr: PropTypes.object,
tdStyle: PropTypes.object,
thStyle: PropTypes.object,
keyValidator: PropTypes.bool,
Expand Down Expand Up @@ -305,6 +306,7 @@ TableHeaderColumn.defaultProps = {
sortIndicator: true,
expandable: true,
tdAttr: undefined,
editTdAttr: undefined,
tdStyle: undefined,
thStyle: undefined,
keyValidator: false,
Expand Down

0 comments on commit 42e84b7

Please sign in to comment.