新增 | onDropBorder | 拖拽释放回调函数(调整列宽) | function | (e) => {} |
This commit is contained in:
parent
61d28a60af
commit
2560ff4697
|
@ -60,6 +60,10 @@ class Demo23 extends Component {
|
|||
return <DragColumnTable columns={columns23} data={data23} bordered
|
||||
dragborder={true}
|
||||
draggable={true}
|
||||
|
||||
onDropBorder ={(e)=>{
|
||||
console.log("调整列宽后触发事件");
|
||||
}}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,9 @@ const SumTable = sum(Table);
|
|||
| ------ | ---------- | -------- | ---- |
|
||||
| dragborder | 拖拽调整列宽度 | boolean | false |
|
||||
| draggable | 拖拽交换列 | boolean | false |
|
||||
| onDrop | 拖拽释放回调函数 | function | () => {} |
|
||||
| onDrop | 拖拽释放回调函数(交换列) | function | () => {} |
|
||||
| onDropBorder | 拖拽释放回调函数(调整列宽) | function | (e) => {} |
|
||||
|
||||
|
||||
#### 使用
|
||||
|
||||
|
|
|
@ -318,7 +318,7 @@ class Table extends Component {
|
|||
|
||||
getHeader(columns, fixed) {
|
||||
const { filterDelay, onFilterChange, onFilterClear, filterable, showHeader, expandIconAsCell, clsPrefix, onDragStart, onDragEnter, onDragOver, onDrop, draggable,
|
||||
onMouseDown, onMouseMove, onMouseUp, dragborder, onThMouseMove, dragborderKey, minColumnWidth, headerHeight,afterDragColWidth,headerScroll ,bordered} = this.props;
|
||||
onMouseDown, onMouseMove, onMouseUp, dragborder, onThMouseMove, dragborderKey, minColumnWidth, headerHeight,afterDragColWidth,headerScroll ,bordered,onDropBorder} = this.props;
|
||||
const rows = this.getHeaderRows(columns);
|
||||
if (expandIconAsCell && fixed !== 'right') {
|
||||
rows[0].unshift({
|
||||
|
@ -331,7 +331,7 @@ class Table extends Component {
|
|||
|
||||
const trStyle = headerHeight&&!fixed ? { height: headerHeight } : (fixed ? this.getHeaderRowStyle(columns, rows) : null);
|
||||
let drop = draggable ? { onDragStart, onDragOver, onDrop, onDragEnter, draggable } : {};
|
||||
let dragBorder = dragborder ? { onMouseDown, onMouseMove, onMouseUp, dragborder, onThMouseMove, dragborderKey } : {};
|
||||
let dragBorder = dragborder ? { onMouseDown, onMouseMove, onMouseUp, dragborder, onThMouseMove, dragborderKey,onDropBorder } : {};
|
||||
let contentWidthDiff = 0;
|
||||
//非固定表格,宽度不够时自动扩充
|
||||
if (!fixed) {
|
||||
|
|
|
@ -235,6 +235,7 @@ class TableHeader extends Component {
|
|||
*/
|
||||
onLineMouseUp = (event) => {
|
||||
this.clearDragBorder(event);
|
||||
this.props.onDropBorder(event)
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue