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

Editor set content without set focus

1 Answer 33 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mohamed Ramadan
Top achievements
Rank 1
Mohamed Ramadan asked on 24 Oct 2010, 11:55 AM
Hello,

I have a code to set content of the editor when it get blur.

function OnClientLoad(editor, args) {
            var element = document.all ? editor.get_document().body : editor.get_document();
            $telerik.addExternalHandler(element, "blur", function(e) {
                if (editor.get_text() == "") {
                    editor.set_html("content");
                }     
           });
        }

but It set the focus back to editor.

I want to set the editor content without set it's focus.


Thanks,
Mohamed Ramadan

1 Answer, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 24 Oct 2010, 09:11 PM
Hello Ayman,

You can set the content without setting the focus in RadEditor using the following code:

editor.get_document().body.innerHTML = "new content";


Sincerely yours,
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
Mohamed Ramadan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or