Skip to content

Commit 42e84b7

Browse files
committed
fix #1478, use editTdAttr to add attribute to TD when cell editing
1 parent 249b1ef commit 42e84b7

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

src/BootstrapTable.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ class BootstrapTable extends Component {
200200
export: column.props.export,
201201
expandable: column.props.expandable,
202202
attrs: column.props.tdAttr,
203+
editAttrs: column.props.editTdAttr,
203204
style: column.props.tdStyle
204205
};
205206

src/TableBody.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class TableBody extends Component {
7373
completeEdit={ this.handleCompleteEditCell }
7474
// add by bluespring for column editor customize
7575
editable={ editable }
76+
attrs={ column.editAttrs }
7677
customEditor={ column.customEditor }
7778
format={ column.format ? format : false }
7879
key={ i }

src/TableEditColumn.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ class TableEditColumn extends Component {
189189
customEditor,
190190
isFocus,
191191
customStyleWithNav,
192-
row
192+
row,
193+
attrs
193194
} = this.props;
194195
const { shakeEditor } = this.state;
195196
const attr = {
@@ -241,6 +242,7 @@ class TableEditColumn extends Component {
241242

242243
return (
243244
<td ref='td'
245+
{ ...attrs }
244246
style={ style }
245247
className={ className }
246248
onClick={ this.handleClick }>
@@ -275,6 +277,7 @@ TableEditColumn.propTypes = {
275277
className: PropTypes.any,
276278
beforeShowError: PropTypes.func,
277279
isFocus: PropTypes.bool,
280+
attrs: PropTypes.object,
278281
customStyleWithNav: PropTypes.oneOfType([ PropTypes.func, PropTypes.object ])
279282
};
280283

src/TableHeaderColumn.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ TableHeaderColumn.propTypes = {
269269
export: PropTypes.bool,
270270
expandable: PropTypes.bool,
271271
tdAttr: PropTypes.object,
272+
editTdAttr: PropTypes.object,
272273
tdStyle: PropTypes.object,
273274
thStyle: PropTypes.object,
274275
keyValidator: PropTypes.bool,
@@ -305,6 +306,7 @@ TableHeaderColumn.defaultProps = {
305306
sortIndicator: true,
306307
expandable: true,
307308
tdAttr: undefined,
309+
editTdAttr: undefined,
308310
tdStyle: undefined,
309311
thStyle: undefined,
310312
keyValidator: false,

0 commit comments

Comments
 (0)