On the Editor select event I want to move the cursor to the next range depending upon specific criteria. I've seen this link but didnt do what I wanted.
Basically I'm using the snippets functionality of Editor control to add MergeFields into the HTML. The snippet looks like this:
<
span
id
=
'MergeField'
style
=
'background-color:blue'
>[[Merge Field 1]]</
span
>
When a uses selects this MergeField i.e. places the cursor in it I detect it in the select event then I want to programatically move the cursor into the next range (or after the merge span) so that the user cant mess with the merge fields. How do I move cursor to next range or end of MergeField span?
The function is below:
function
editorSelect(e) {
var
editor = $(
"#Content"
).data(
"kendoEditor"
);
var
selection = editor.getSelection();
var
range = editor.getRange();
var
startNode = range.startContainer;
if
(startNode.parentElement && startNode.parentElement.id ===
'MergeField'
) {
alert(
'Im a Merge Field!'
);
//Move cursor to after the MergeField span.
???
}
}