reinitialize kendoDraggable

5 posts, 0 answers
  1. Yaroslav
    Yaroslav avatar
    2 posts
    Member since:
    Feb 2012

    Posted 15 Feb 2012 Link to this post

    I need to reinitialize kendoDraggable on list of elements that were previously initialized.

    I tried doing:
    $('selector').removeData("kendoDraggable")

    but this does not help: I still get hing from previous definition.
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 20 Feb 2012 Link to this post

    Hello Yaroslav,

    While this functionality is not officially supported, you could unbind all drag events from the draggable in the following way:

    $("#draggable").unbind(".kendo-dnd"); 

    It is recommended that you submit a request for an official API in uservoice, since it would be more reliable than the above hack.

    Regards,
    Alex Gyoshev
    the Telerik team
    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. John
    John avatar
    17 posts
    Member since:
    Jul 2010

    Posted 07 Mar 2014 in reply to Alex Gyoshev Link to this post

    Do you know if there is a solution for this now or is the hack method you mentioned still the only way?

    Thanks
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 11 Mar 2014 Link to this post

    Hello John,

    If you get the instance of the Draggable class, you should be able to detach it by calling its destroy method.

    Regards,
    Alex Gyoshev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. beauXjames
    beauXjames avatar
    20 posts
    Member since:
    Aug 2012

    Posted 02 Apr 2014 Link to this post

    Here's an example for pulling this one off...

    var $element = $(element);
    if ( $element.data('kendoDraggable') ) {
        $element.data('kendoDraggable').destroy();
    }
Back to Top
Kendo UI is VS 2017 Ready