Skip to content

Commit

Permalink
fix #144
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Nov 21, 2015
1 parent 25715ac commit 4d0f7cd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@ class TableBody extends React.Component{
selectRowHeader = this.props.selectRow.hideSelectColumn?null:(<th style={style} key={-1}></th>);
}
var theader = this.props.columns.map(function(column, i){
let width = parseInt(column.width);
let style={
display: column.hidden?"none":null,
width: column.width,
maxWidth: column.width
width: width,
maxWidth: width
/** add min-wdth to fix user assign column width not eq offsetWidth in large column table **/
};
let sortCaert = column.sort?(Util.renderReactSortCaret(Const.SORT_DESC)):null;
Expand Down
11 changes: 5 additions & 6 deletions src/TableColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@ class TableColumn extends React.Component{
}

render(){
var width = parseInt(this.props.width);
var tdStyle = {
textAlign: this.props.dataAlign,
display: this.props.hidden?"none":null,
width: this.props.width,
maxWidth: this.props.width
width: width,
maxWidth: width
};
var classname = this.props.className;
if(this.props.width &&
this.props.width !== null && this.props.width.indexOf('px') > -1){
let w = this.props.width.replace('px','');
classname += " col-md-"+w;
if(this.props.width){
classname += " col-md-"+width;
}


Expand Down
5 changes: 3 additions & 2 deletions src/TableHeaderColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ class TableHeaderColumn extends React.Component{
}

render(){
var width = this.props.width!==null?parseInt(this.props.width):null;
var thStyle = {
textAlign: this.props.dataAlign,
display: this.props.hidden?"none":null,
width: this.props.width,
maxWidth: this.props.width
width: width,
maxWidth: width
};

var classes = this.props.className+" "+(this.props.dataSort?"sort-column":"");
Expand Down

0 comments on commit 4d0f7cd

Please sign in to comment.