reinitialize kendoDraggable

7 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
    2510 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. 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
  4. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2510 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!
  5. 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();
    }
  6. Todd
    Todd avatar
    1 posts
    Member since:
    Dec 2014

    Posted 16 Mar Link to this post

    is there a function simillar to kendo.ui.DropTarget.destroyGroup("group name"); to destory the draggable elements?
  7. Stefan
    Admin
    Stefan avatar
    595 posts

    Posted 22 Mar Link to this post

    Hello Todd,

    Currently, a similar function is not available for the Draggable widget.

    The Draggable widgets can be destroyed only individually as shown in the previous reply.

    I can suggest submitting a feature request in our feedback portal and based on its popularity we may implement it in a future release:

    http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/category/63713-drag-drop

    Regards,
    Stefan
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top