bee-table7/demo/demolist/Demo1002.js

68 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
*
* @title 拖拽改变列宽度
* @parent 列操作-拖拽 Drag
* @description onDropBorder方法为调整列宽后触发的回调函数。注不支持tree结构的表头。
* demo1002
*/
import React, { Component } from 'react';
import Table from '../../src';
import dragColumn from '../../src/lib/dragColumn';
const columns = [
{
title: "订单编号",
dataIndex: "a",
key: "a",
width: '200',
fixed:'left'
},
{
title: "单据日期",
dataIndex: "b",
key: "b",
width: '600'
},
{
title: "供应商",
dataIndex: "c",
key: "c",
width: '200',
},
{
title: "联系人",
dataIndex: "d",
key: "d",
width: 500,
}
];
const data = [
{ a: "NU0391001", b: "2019-03-01", c: "xx供应商",d:'Tom', key: "2" },
{ a: "NU0391002", b: "2018-11-02", c: "yy供应商",d:'Jack', key: "1" },
{ a: "NU0391003", b: "2019-05-03", c: "zz供应商",d:'Jane', key: "3" }
];
const DragColumnTable = dragColumn(Table);
class Demo30 extends Component {
constructor(props) {
super(props);
}
render() {
return <DragColumnTable
columns={columns}
data={data}
bordered
scroll={{y:200}}
dragborder={true}
onDropBorder ={(e,width)=>{
console.log(width+"--调整列宽后触发事件",e.target);
}}
/>;
}
}
export default Demo30;