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

KendoEditor + dropTarget

2 Answers 336 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
Monish
Top achievements
Rank 1
Monish asked on 18 Sep 2012, 07:25 AM

Hi,

I am trying to implement a scenario where user can drop nodes from the tree to an editor. By default all the nodes are draggable of the kendo treeview control so I have to remove the dragAndDrop and use kendoDraggable so that parent nodes are not draggable. This is working fine by using templates.

Now, for the editor part, if I apply kendoEditor to the textarea and make it kendoDropTarget, the drop functionality is not working. However this works if I keep textarea as it is (without kendo editor) and apply kendoDropTarget to the textarea. Not sure what I am missing?

The code snippet is share at: http://jsfiddle.net/N4PVu/

Regards,
Monish.

2 Answers, 1 is accepted

Sort by
0
Nohinn
Top achievements
Rank 1
answered on 18 Sep 2012, 09:11 AM
the kendoEditor() function hides the textarea and instead uses a table and an iframe, that's why it stops working for you as the textarea dom element is not visible anymore.
I don't think there is any easy way to make it work within the editor's iframe, as the iframe is like a different environment for your application.

P.S: This is the only thing I've been able to do with your sample http://jsfiddle.net/N4PVu/1/ as you will see, when the node drag starts I'm drawing an overlay over the iframe, so the iframe does not capture the mouse. I apply the kendoDropTarget to this overlay, and in the drop event I have set to "insert" a copy of the hint inside the iframe.
0
Dominic
Top achievements
Rank 1
answered on 26 Sep 2013, 10:12 AM
I know this thread is over a year old but thought I would post my solution in case you didn't get it working. 

I based my solution on both of your jsfiddles (Using a div overlay and not using the treeviews built in drag and drop). 
It is quite hacky and definitely needs tidying up/re-factoring but I hope this helps. 
Note: Having the paragraphs causes this to not work properly in IE. If you remove the <p> tags it works fine. 
I have tested this in IE10, Firefox 24 and chrome 29.

http://jsfiddle.net/j55Bc/67/

Dom
Tags
Drag and Drop
Asked by
Monish
Top achievements
Rank 1
Answers by
Nohinn
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Share this question
or