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

Editor control throwing error while getting start position

1 Answer 44 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Balaji
Top achievements
Rank 1
Balaji asked on 09 May 2012, 07:46 AM
Hi,
 
  I tried the below piece of code to get the start position of the selected text in Telerik RadEditor control.

var range, text, startpos;
var doc = editor.get_document();
range = editor.getSelectedElement().createTextRange();
text = range.text; var dup = range.duplicate();
range.moveToBookmark(doc.selection.createRange().getBookmark());
dup.setEndPoint('EndToStart', range);
startpos = dup.text.length;


At first time, i get the startposition, if i clear the text again and insert some text and execute the above code, it is throwing error: object doesnt support at the location:range = editor.getSelectedElement().createTextRange();

Please help me to fix the issue.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 11 May 2012, 02:33 PM
Hello,

Can you please provide a fully working example, sample content and steps or a video on how to reproduce the issue?

You can also try to implement your solution with a standard textbox and send us the code. We will help you to integrate it in RadEditor.

All the best,
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
Balaji
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or