Skip to content

Commit

Permalink
fix #878
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Jan 7, 2017
1 parent c9c9147 commit a44e189
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ class BootstrapTable extends Component {
sortFuncExtraData: column.props.sortFuncExtraData,
export: column.props.export,
expandable: column.props.expandable,
index: i
index: i,
attrs: column.props.tdAttr
};
}
});
Expand Down
3 changes: 2 additions & 1 deletion src/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class TableBody extends Component {
hidden={ column.hidden }
onEdit={ this.handleEditCell }
width={ column.width }
onClick={ this.handleClickCell }>
onClick={ this.handleClickCell }
attrs={ column.attrs }>
{ columnChild }
</TableColumn>
);
Expand Down
8 changes: 5 additions & 3 deletions src/TableColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class TableColumn extends Component {
className,
dataAlign,
hidden,
cellEdit
cellEdit,
attrs
} = this.props;

const tdStyle = {
Expand All @@ -96,7 +97,7 @@ class TableColumn extends Component {
<td style={ tdStyle }
title={ columnTitle }
className={ className }
{ ...opts }>
{ ...opts } { ...attrs }>
{ typeof children === 'boolean' ? children.toString() : children }
</td>
);
Expand All @@ -109,7 +110,8 @@ TableColumn.propTypes = {
className: PropTypes.string,
columnTitle: PropTypes.string,
children: PropTypes.node,
onClick: PropTypes.func
onClick: PropTypes.func,
attrs: PropTypes.object
};

TableColumn.defaultProps = {
Expand Down
6 changes: 4 additions & 2 deletions src/TableHeaderColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ TableHeaderColumn.propTypes = {
}),
sortIndicator: PropTypes.bool,
export: PropTypes.bool,
expandable: PropTypes.bool
expandable: PropTypes.bool,
tdAttr: PropTypes.object
};

TableHeaderColumn.defaultProps = {
Expand Down Expand Up @@ -283,7 +284,8 @@ TableHeaderColumn.defaultProps = {
sortFuncExtraData: undefined,
filter: undefined,
sortIndicator: true,
expandable: true
expandable: true,
tdAttr: undefined
};

export default TableHeaderColumn;

0 comments on commit a44e189

Please sign in to comment.