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

[Solved] location of formatting insertion

1 Answer 92 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Afendi Hamat
Top achievements
Rank 1
Afendi Hamat asked on 05 Mar 2010, 08:10 AM
hi all,
i've folllowed some of the examples here and managed to insert different formatting in <span> tags into the editor (using editor.fire pastehtml). Right now the formatting appear where the cursor is. Is there a way to insert directly at the end of the content in the editor no matter where the cursor is?
FYI, the contents are not within a div tag, just plain text. thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 10 Mar 2010, 12:41 PM
Hi Afendi,

Yes, the pasteHtml method inserts content at cursor position and it does not offer the ability to insert content at the end of the content.

If you would like to manipulate the cursor / caret position in the editor's content area, then my recommendation is to implement your scenario with an editable IFRAME (the content area of RadEditor is an editable IFRAME) or editable DIV, using the Range object. Information regarding TextRange is available in these articles:
http://www.wrox.com/WileyCDA/Section/JavaScript-DOM-Ranges-Page-2.id-292302.html
http://www.quirksmode.org/dom/range_intro.html
http://msdn.microsoft.com/en-us/library/ms535872%28VS.85%29.aspx

If you succeed and implement it, send us the code and we will replace the IFRAME with RadEditor and integrate the code to work with the editor control.

Greetings,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Afendi Hamat
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or