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

Drag And Drop removes HTML tags?

3 Answers 80 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Tommy Walsh
Top achievements
Rank 1
Tommy Walsh asked on 01 Apr 2009, 09:19 PM
I'm having a problem with the drag and drop function. It seems on every drag and drop, any HTML tags are removed from the node text. I have these things being added with images, font differences, etc. I can reset the text on each drag and drop, but that's sort of a pain. Is there any way I can fix this?

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 02 Apr 2009, 10:47 AM
Hi Tommy Walsh,

Could you please elaborate on your specific scenario? Are you using client or server drag and drop? Do you use templates or just set the text property of the nodes to some html? Ideally you could send us some code.

Regards,
Albert
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Tommy Walsh
Top achievements
Rank 1
answered on 02 Apr 2009, 02:53 PM

I'm using client side drag and drop, and no templates, just some HTML in the text field. I have a ton of code to deal with different scenarios that is wholly uninteresting to you. What I've found is that as soon as you enter the onClientNodeDropping event, if you check eventArgs.get_sourceNode().get_text(), any HTML tags are completely gone. Also gone were some  's I had added.

I have a workaround in place at the moment that fixes the whole problem. I save the text in a custom attribute (called "Text"), and use set_text after each drag and drop. Just thought I'd bring this up because it's very weird.

0
Atanas Korchev
Telerik team
answered on 02 Apr 2009, 04:39 PM
Hi Tommy Walsh,

This is by design - the text property returns text only (strips out html). However calling get_text should not remove the text of the node. I suggest you use get_textElement().innerHTML in case you need the HTML.

Regards,
Albert
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Tommy Walsh
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Tommy Walsh
Top achievements
Rank 1
Share this question
or