This is a migrated thread and some comments may be shown as answers.

Kendo Grid kendoDropTargetArea cancel drag on drop

1 Answer 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 27 Mar 2014, 03:23 AM
Hi, I'm setting up a kendoDropTargetArea on a grid like this:

    _setupDropTargets: function() {
      var _this = this;
      this.grid.tbody.kendoDropTargetArea({
        group: 'allocationDetailsGroup',
        filter: this.dropSelector,
        drop: function(e) {
          if (_this._canDrop(e)) {
            return _this._doDrop(e);
          } else  {cancel dragging here}
        }
      });
      return this;
    }

What do I put in "cancel dragging here", so that the draggable floats back to its original position? (right now it disappears).

Tom
 

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 28 Mar 2014, 04:02 PM
Hi Tom,

Please use the preventDefault method.
drop: function(e) {
  if (_this._canDrop(e)) {
    return _this._doDrop(e);
  } else  {
    e.preventDefault();
  }
}



Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Tom
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or