拖拽回调函数时机修改
This commit is contained in:
parent
f2c99f0cc7
commit
5d98bced94
|
@ -127,10 +127,7 @@ var TableHeader = function (_Component) {
|
||||||
};
|
};
|
||||||
|
|
||||||
_this.onLineMouseUp = function (event) {
|
_this.onLineMouseUp = function (event) {
|
||||||
var rows = _this.props.rows;
|
|
||||||
|
|
||||||
var data = { rows: rows[0], cols: _this.table.cols, currIndex: _this.drag.currIndex };
|
|
||||||
_this.props.afterDragColWidth && _this.props.afterDragColWidth(data);
|
|
||||||
_this.clearDragBorder(event);
|
_this.clearDragBorder(event);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -446,7 +443,11 @@ var TableHeader = function (_Component) {
|
||||||
|
|
||||||
TableHeader.prototype.clearDragBorder = function clearDragBorder() {
|
TableHeader.prototype.clearDragBorder = function clearDragBorder() {
|
||||||
// if (!this.props.dragborder || !this.props.draggable) return;
|
// if (!this.props.dragborder || !this.props.draggable) return;
|
||||||
if (!this.drag) return;
|
if (!this.drag || !this.drag.option) return;
|
||||||
|
var rows = this.props.rows;
|
||||||
|
|
||||||
|
var data = { rows: rows[0], cols: this.table.cols, currIndex: this.drag.currIndex };
|
||||||
|
this.props.afterDragColWidth && this.props.afterDragColWidth(data);
|
||||||
this.drag = {
|
this.drag = {
|
||||||
option: ""
|
option: ""
|
||||||
};
|
};
|
||||||
|
|
|
@ -210,9 +210,7 @@ class TableHeader extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
onLineMouseUp = (event) => {
|
onLineMouseUp = (event) => {
|
||||||
let {rows} = this.props;
|
|
||||||
let data = {rows:rows[0],cols:this.table.cols,currIndex:this.drag.currIndex};
|
|
||||||
this.props.afterDragColWidth && this.props.afterDragColWidth(data);
|
|
||||||
this.clearDragBorder(event);
|
this.clearDragBorder(event);
|
||||||
};
|
};
|
||||||
bodyonLineMouseMove = (event) => {
|
bodyonLineMouseMove = (event) => {
|
||||||
|
@ -221,7 +219,10 @@ class TableHeader extends Component {
|
||||||
|
|
||||||
clearDragBorder(){
|
clearDragBorder(){
|
||||||
// if (!this.props.dragborder || !this.props.draggable) return;
|
// if (!this.props.dragborder || !this.props.draggable) return;
|
||||||
if(!this.drag)return;
|
if(!this.drag || !this.drag.option)return;
|
||||||
|
let {rows} = this.props;
|
||||||
|
let data = {rows:rows[0],cols:this.table.cols,currIndex:this.drag.currIndex};
|
||||||
|
this.props.afterDragColWidth && this.props.afterDragColWidth(data);
|
||||||
this.drag = {
|
this.drag = {
|
||||||
option:""
|
option:""
|
||||||
};
|
};
|
||||||
|
@ -281,7 +282,6 @@ class TableHeader extends Component {
|
||||||
let event = Event.getEvent(e);
|
let event = Event.getEvent(e);
|
||||||
if (!this.props.draggable) return;
|
if (!this.props.draggable) return;
|
||||||
if(this.drag.option === 'border'){return;}
|
if(this.drag.option === 'border'){return;}
|
||||||
console.log(this.drag.option+' -------onDragStart----------',event.target);
|
|
||||||
let th = this.getThDome(event.target);
|
let th = this.getThDome(event.target);
|
||||||
if(!th)return;
|
if(!th)return;
|
||||||
let currentIndex = parseInt(th.getAttribute("data-line-index"));
|
let currentIndex = parseInt(th.getAttribute("data-line-index"));
|
||||||
|
@ -318,7 +318,6 @@ class TableHeader extends Component {
|
||||||
this.currentDome.setAttribute('draggable',false);//添加交换列效果
|
this.currentDome.setAttribute('draggable',false);//添加交换列效果
|
||||||
let data = this.getCurrentEventData(e);
|
let data = this.getCurrentEventData(e);
|
||||||
if(!data)return;
|
if(!data)return;
|
||||||
console.log(this.drag.option+' -------onDrop----------',event.target);
|
|
||||||
if (!this.currentObj || this.currentObj.key == data.key) return;
|
if (!this.currentObj || this.currentObj.key == data.key) return;
|
||||||
if(!this.props.onDrop)return;
|
if(!this.props.onDrop)return;
|
||||||
this.props.onDrop(event,{dragSource:this.currentObj,dragTarg:data});
|
this.props.onDrop(event,{dragSource:this.currentObj,dragTarg:data});
|
||||||
|
|
Loading…
Reference in New Issue