holdToDrag duration

4 posts, 0 answers
  1. Nick
    Nick avatar
    31 posts
    Member since:
    Oct 2011

    Posted 21 Nov 2014 Link to this post

    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
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 25 Nov 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Nick
    Nick avatar
    31 posts
    Member since:
    Oct 2011

    Posted 25 Nov 2014 in reply to Alexander Valchev Link to this post

    Worked, thanks!

    Was that in the documentation somewhere that I just missed?

      Nick
  5. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 26 Nov 2014 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready