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

Removing drag and drop

5 Answers 390 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 1
Charlie asked on 20 Mar 2015, 05:55 PM
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 ?

5 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 24 Mar 2015, 09:34 AM
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!
 
0
Charlie
Top achievements
Rank 1
answered on 24 Mar 2015, 05:38 PM
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.
0
Accepted
Alexander Valchev
Telerik team
answered on 26 Mar 2015, 04:40 PM
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!
 
0
Charlie
Top achievements
Rank 1
answered on 01 Apr 2015, 08:50 PM
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();
  }
0
Alexander Valchev
Telerik team
answered on 03 Apr 2015, 09:06 AM
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!
 
Tags
Drag and Drop
Asked by
Charlie
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Charlie
Top achievements
Rank 1
Share this question
or