Drag And Drop removes HTML tags?

4 posts, 0 answers
  1. Tommy Walsh
    Tommy Walsh avatar
    7 posts
    Member since:
    Sep 2008

    Posted 01 Apr 2009 Link to this post

    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?
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 02 Apr 2009 Link to this post

    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.
  3. Tommy Walsh
    Tommy Walsh avatar
    7 posts
    Member since:
    Sep 2008

    Posted 02 Apr 2009 Link to this post

    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.

  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 02 Apr 2009 Link to this post

    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.
Back to Top