综合table

This commit is contained in:
jonyshi 2018-06-25 16:10:07 +08:00
parent 28acd42a2e
commit c44258997b
1 changed files with 15 additions and 9 deletions

View File

@ -65,8 +65,8 @@ const columns25 = [
title: "操作", title: "操作",
dataIndex: "e", dataIndex: "e",
key: "e", key: "e",
fixed: "right",
width: 100, width: 100,
fixed: "right",
render(text, record, index) { render(text, record, index) {
return ( return (
<div style={{position: 'relative'}} title={text} > <div style={{position: 'relative'}} title={text} >
@ -76,11 +76,6 @@ const columns25 = [
onClick={() => { onClick={() => {
alert('这是第'+index+'列,内容为:'+text); alert('这是第'+index+'列,内容为:'+text);
}} }}
style={{
position: 'absolute',
top: 5,
left: 0
}}
> >
操作 操作
</a> </a>
@ -215,14 +210,25 @@ class Demo25 extends Component {
console.log("data",data); console.log("data",data);
} }
getCloumnsScroll=(columns)=>{
let sum = 0;
columns.forEach((da)=>{
sum += da.width;
})
console.log("sum",sum);
return (sum);
}
render() { render() {
let columns = getCloumns();
return <div className="demo25"><DragColumnTable return <div className="demo25"><DragColumnTable
columns={columns25} columns={columns}
data={data25} data={dataList}
getSelectedDataFunc={this.getSelectedDataFunc} getSelectedDataFunc={this.getSelectedDataFunc}
bordered bordered
dragborder={true} dragborder={true}
scroll={{x:700}} scroll={{x:this.getCloumnsScroll(columns)}}
multiSelect={{type: "checkbox"}} multiSelect={{type: "checkbox"}}
/></div> /></div>
} }