Unable to Append Text

4 posts, 0 answers
  1. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 11 Aug 2008 Link to this post

    I hope I'm just missing something.  :)

    I cannot, through the design view, append content to the very end of what is there - unless there is a <br> at the end.  I can switch to HTML view, but I don't always want to provide the HTML view for my non-web-savvy clients.

    Example:  If I have code in the editor like this:

    <div> 
      <p>....</p> 
      <p>....</p> 
      <p>....</p> 
    </div> 

    I can't append anything from HTML view without it appearing inside the div tag.

    Thanks for any assistance.

  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 12 Aug 2008 Link to this post

    Hi Barry,

    This is a browser behavior. RadEditor's content area is an editable IFRAME element which uses the Rich Text Editing engine of the browser and this scenario is controlled by the browser. You can test the same scenario with our competitors' editor as well as editable DIV / IFRAME elements and you will see identical results as in our editor.

        <div style="border: 1px solid red;width: 500px;height:300px;overflow: scroll;" id="editableDIV" contenteditable="true">
            <div>
              <p>....</p>
              <p>....</p>
              <p>....</p>
            </div>
        </div>

    That is why the only possible way to add content outside of the DIV tag is to use the Real Time HTML module or switch to Html mode.

    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 12 Aug 2008 Link to this post

    I haven't researched custom buttons yet, but could you (or could I) create a button to append to the end of the content?  Thus, if a user can't do this, they could click the button that would do something like add a <br /> to the end of the content (or a <p></p>) and place the cursor there?

    Thank you.

  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 12 Aug 2008 Link to this post

    Hi,

    Yes, you can create a custom button that will add a <br /> to the end of the content.

    You can get the currently selected element in the content area with editor.getSelectedElement().
    The current content can be obtained with editor.get_html(true) and you can set new content with editor.set_html(content).

    You can find more information about the editor's client api in the help.

    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top