fix: headerScrol=true数据量大时,表头和表体滚动条长度不一致
This commit is contained in:
parent
acf29b253a
commit
4198316b1b
|
@ -387,11 +387,10 @@ var Table = function (_Component) {
|
|||
var bodyH = this.refs.bodyTable.clientHeight;
|
||||
var bodyContentH = this.refs.bodyTable.querySelector('table').clientHeight;
|
||||
var rightBodyTable = this.refs.fixedColumnsBodyRight;
|
||||
if (bodyContentH <= bodyH) {
|
||||
this.refs.bodyTable.style.overflowY = 'auto';
|
||||
this.refs.headTable.style.overflowY = 'auto';
|
||||
rightBodyTable && (rightBodyTable.style.overflowY = 'auto');
|
||||
}
|
||||
var overflowy = bodyContentH <= bodyH ? 'auto' : 'scroll';
|
||||
this.refs.bodyTable.style.overflowY = overflowy;
|
||||
this.refs.headTable.style.overflowY = overflowy;
|
||||
rightBodyTable && (rightBodyTable.style.overflowY = overflowy);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ class Demo12 extends Component {
|
|||
getSelectedDataFunc = (selectedList,record,index) => {
|
||||
console.log("selectedList", selectedList,"index",index);
|
||||
// 如果在回调中增加setState逻辑,需要同步data中的_checked属性。即下面的代码
|
||||
const allChecked = selectedList.length == 0?false:true;
|
||||
// const allChecked = selectedList.length == 0?false:true;
|
||||
// record为undefind则为全选或者全不选
|
||||
// if(!record){
|
||||
// data12.forEach(item=>{
|
||||
|
|
|
@ -53,7 +53,7 @@ const data5 = [
|
|||
|
||||
class Demo5 extends Component {
|
||||
render() {
|
||||
return <Table columns={columns5} data={data5} scroll={{ x: "110%", y: 340 }} bodyStyle={{height:'340px'}} />;
|
||||
return <Table columns={columns5} data={data5} scroll={{ x: "110%", y: 240 }} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -277,14 +277,13 @@ class Table extends Component {
|
|||
const bodyH = this.refs.bodyTable.clientHeight;
|
||||
const bodyContentH = this.refs.bodyTable.querySelector('table').clientHeight;
|
||||
const rightBodyTable = this.refs.fixedColumnsBodyRight;
|
||||
if(bodyContentH <= bodyH){
|
||||
this.refs.bodyTable.style.overflowY='auto';
|
||||
this.refs.headTable.style.overflowY='auto';
|
||||
rightBodyTable && (rightBodyTable.style.overflowY='auto');
|
||||
const overflowy = bodyContentH <= bodyH ? 'auto':'scroll';
|
||||
this.refs.bodyTable.style.overflowY = overflowy;
|
||||
this.refs.headTable.style.overflowY = overflowy;
|
||||
rightBodyTable && (rightBodyTable.style.overflowY = overflowy);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
onExpandedRowsChange(expandedRowKeys) {
|
||||
if (!this.props.expandedRowKeys) {
|
||||
this.setState({ expandedRowKeys });
|
||||
|
|
Loading…
Reference in New Issue