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

holdToDrag duration

3 Answers 83 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 21 Nov 2014, 10:53 PM
http://docs.telerik.com/kendo-ui/api/framework/draggable#configuration-holdToDrag

Is it possible to configure how long the user has to hold before it starts dragging?  It feels a little long to me right now.

  Nick

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 25 Nov 2014, 02:27 PM
Hello Nick,

Thank you for contacting us.

The Draggable does not expose configuration option that lets you determine the hold time. If you want to change the default one you may use the following approach:
$("#draggable").kendoDraggable({
  holdToDrag: true,
  hold: function(e) {
      $("draggable").css("background", "red");
  },
  hint: function(element) {
    var hintElement = $("<div id='hint'></div>");
    hintElement.css({
      "background": "red",
      "width": "230px",
      "height": "80px"
    });
    return hintElement;
  }
})
.data("kendoDraggable")
.userEvents
.minHold = 100; //set the min hold time

I hope the information will help.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jeff
Top achievements
Rank 1
answered on 25 Nov 2014, 04:11 PM
Worked, thanks!

Was that in the documentation somewhere that I just missed?

  Nick
0
Alexander Valchev
Telerik team
answered on 26 Nov 2014, 10:20 AM
Hello Nick,

That is not written in the documentation. As said before the Draggable does not expose a build-in configuration option that lets you determine the hold time.
The suggested solution is more like a workaround which you may use.

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
Drag and Drop
Asked by
Jeff
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or