Removing drag and drop

7 posts, 1 answers
  1. Charlie
    Charlie avatar
    5 posts
    Member since:
    Mar 2015

    Posted 20 Mar 2015 Link to this post

    I need both inline editing and drag and drop support for columns.  To do this I register a double click handler , try to remove drag and drop, and then add kendoEditor support.

    Ive tried http://www.telerik.com/forums/disabling-drag-and-drop for removing it but none of those options are working.

    What else can I do to achieve this ?
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 24 Mar 2015 Link to this post

    Hello Charlie,

    Your scenario is a bit unclear. Could you please provide small but runnable Kendo Dojo test page which demonstrates your current implementation so I can examine it and assist you further?

    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. Charlie
    Charlie avatar
    5 posts
    Member since:
    Mar 2015

    Posted 24 Mar 2015 Link to this post

    Here is code that extends the inline editor example  http://dojo.telerik.com/UtUpE . 

    When a user double clicks a column, I want to disable drag and drop, create a kendoEditor() , and trigger the editing action on that column.
  5. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 26 Mar 2015 Link to this post

    Hello Charlie,

    Please see the updated example: http://dojo.telerik.com/@valchev/ivUyu

    In order to disable the draggable you may simply destroy it:

    $('#col1,#col2,#col3').dblclick(function (event) {
     
      if($(event.currentTarget).data("kendoDraggable")) {
        $(event.currentTarget).data("kendoDraggable").destroy();
      }
      
      $(event.currentTarget).kendoEditor({
        tools: [
          "bold",
          "italic",
          "underline",
          "createLink",
          "unlink",
          "insertImage"
        ]
      })
       
      $(event.currentTarget).focus();
     
    });


    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Charlie
    Charlie avatar
    5 posts
    Member since:
    Mar 2015

    Posted 01 Apr 2015 in reply to Alexander Valchev Link to this post

    Aha thanks!    Does this pattern apply to all kendo widgets ?  For example if I wanted to destroy the "kendoEditor" after the edit is finished can I use the same pattern

    if($(event.currentTarget).data("kendoEditor")) {
        $(event.currentTarget).data("kendoEditor").destroy();
      }
  7. Charlie
    Charlie avatar
    5 posts
    Member since:
    Mar 2015

    Posted 01 Apr 2015 in reply to Alexander Valchev Link to this post

    Aha thanks!  Will this work for all kendoWidgets ?  If I wanted to destroy the kendoEditor after an edit is finished can I use

    if($(event.currentTarget).data("kendoEditor")) {
        $(event.currentTarget).data("kendoEditor")destroy();
      }
  8. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 03 Apr 2015 Link to this post

    Hello Charlie,

    Each Kendo UI widget has destroy method which unbinds the event handlers and removes the client side object of the widget. It is important to know that the destroy method does not remove the mark-up.

    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