drop 增加参数node.props.cloum

This commit is contained in:
jonyshi 2019-08-30 11:39:59 +08:00
parent 8991080cde
commit d7638273ca
3 changed files with 17 additions and 13 deletions

View File

@ -309,6 +309,8 @@ var TableHeader = function (_Component) {
_this.onDrop = function (e) {
if (!_this.props.draggable) return;
var colum = _this.getCurrentEventData(_this._dragCurrent);
e.node = { props: { colum: colum } };
if (_this.drag && _this.drag.option != 'dragAble') {
_this.props.onDrop(e);
return;
@ -316,14 +318,14 @@ var TableHeader = function (_Component) {
var event = _utils.Event.getEvent(e),
target = _utils.Event.getTarget(event);
_this.currentDome.setAttribute('draggable', false); //添加交换列效果
var data = _this.getCurrentEventData(_this._dragCurrent);
if (!data) {
_this.props.onDrop(e);
return;
}
// let data = this.getCurrentEventData(this._dragCurrent);
// if(!data){
// this.props.onDrop(e);
// return;
// }
if (!_this.props.onDrop) return;
// this.props.onDrop(event,target);
_this.props.onDrop(event, { dragSource: _this.currentObj, dragTarg: data });
_this.props.onDrop(event, { dragSource: _this.currentObj, dragTarg: colum });
};
_this.onDragEnter = function (e) {

View File

@ -1,6 +1,6 @@
{
"name": "bee-table",
"version": "2.2.4",
"version": "2.2.5",
"description": "Table ui component for react",
"keywords": [
"react",

View File

@ -488,6 +488,8 @@ class TableHeader extends Component {
*/
onDrop = (e) => {
if (!this.props.draggable) return;
let colum = this.getCurrentEventData(this._dragCurrent)
e.node = {props:{colum}};
if(this.drag && this.drag.option != 'dragAble'){
this.props.onDrop(e);
return;
@ -495,14 +497,14 @@ class TableHeader extends Component {
let event = Event.getEvent(e) ,
target = Event.getTarget(event);
this.currentDome.setAttribute('draggable',false);//添加交换列效果
let data = this.getCurrentEventData(this._dragCurrent);
if(!data){
this.props.onDrop(e);
return;
}
// let data = this.getCurrentEventData(this._dragCurrent);
// if(!data){
// this.props.onDrop(e);
// return;
// }
if(!this.props.onDrop)return;
// this.props.onDrop(event,target);
this.props.onDrop(event,{dragSource:this.currentObj,dragTarg:data});
this.props.onDrop(event,{dragSource:this.currentObj,dragTarg:colum});
};