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

Cursor position when changing from design to html view

3 Answers 37 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Amey
Top achievements
Rank 1
Amey asked on 20 Sep 2011, 03:40 PM
I've noticed that when I switch from design view to HTML view, my cursor does not maintain my position in the html view.  Meaning when i'm halfway down a piece of text, and wish to inspect the underlying HTML, i'm not taken to that same place in the HTML - i'm taken back to the top of the content.  This can make it quite time consuming to go back and find my location.  Is there a way to maintain cursor position while switching views?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 20 Sep 2011, 03:54 PM
Hello Christian,

Unfortunately the desired functionality is not easy to achieve and is not offered out-of-the box by RadEditor. You can try to save the selection range before the user changes the mode to HTML and restore it after he returns back to Design, but you need to consider that content might be changed. You can find helpful information on selection and ranges in the following site:
Introduction to Range.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Amey
Top achievements
Rank 1
answered on 20 Sep 2011, 05:40 PM
Hi Rumen,

It's OK if it's not restored when we go back to the Design view.  I just want the cursor to be in the same place when I switch to HTML view from Design view.
0
Rumen
Telerik team
answered on 21 Sep 2011, 02:47 PM
Hi Christian ,

The requested feature is almost the same as selecting the same content / tag when toggling back from HTML mode to Design mode. Both modes are different iframes which means different documents and it is not trivial to restore the cursor position when changing the iframes when switching between different view modes. In addition, the content is parsed by the editor's content filters to make it valid XHTML. This process modifies the content and it is not possible to programmatically restore the selection.

Have you seen by any chance another web based Rich Text Editor that supports this nice feature?

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Editor
Asked by
Amey
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Amey
Top achievements
Rank 1
Share this question
or