DHTMLXEditor insert text into caret position

Hi Team,

We’re using latest Pro version of your library.

Need to insert pieces of text into the current cursor position inside the editor.
Can you advice any way of doing this.

Example: I’m creating email template. And I have a drop down of standard key words like [UserName] So I just insert them into necessary place.

Sample editor content:
Hello [UserName].

Thank you in advance.

Maxim,
I had the same problem and I thought that I found a solution, check out this thread
http://forum.dhtmlx.com/viewtopic.php?f=7&t=36361&p=112660&hilit=insert+text#p112660

unfortunately it does not work in IE10, at least for me.

Hi rodic66.
Thank you very much for the link you posted. It does exactly what I need.

Like as you mentioned, I also met a problem in IE11 but it was at different line.
Solved by replacing
range.insertNode(document.createTextNode(text));
with
range.insertNode(this.edWin.document.createTextNode(text));

Hope this helps you as well.
Долг платежом красен :wink:
Удачи!

I’m glad that helps, not in my case though, I’m still getting an error right before range gets set, seems like position of the cursor getting lost when I click on the toolbar button. Anyways I will continue to battle that thing.
This forum is extremely helpful for DHTMLX users, I’ve found quite a few undocumented treasures, I wish moderators would compile some “Tips and tricks” section.

Максим, спасибо, если нужен editor по-круче, посмотри здесь http://ckeditor.com.