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

Toolbar Show / Hide Events

1 Answer 65 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 08 Oct 2010, 12:19 PM
Hi

I have a radEditor with its toolbar mode set to "pageTop".  When the toolbar appears and disappears I want to run some custom javascript..

How do I access the toolbar show/hide events through javascript code ?

Also, I want to add my own custom toolbar button which when clicked will hide the toolbar.  Is this possible ?

Thanks

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 08 Oct 2010, 01:04 PM
Hello Stephen Cassels,

The PageTop toolbar appears when the editor gains focus and disappears when the editor loses focus. You can attach to the RadEditor's content area click and blur events using the JavaScript code below:

<telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad" ToolbarMode="PageTop">
</telerik:RadEditor>
<script type="text/javascript">
    function OnClientLoad(editor, args) {
        var element = document.all ? editor.get_document().body : editor.get_document();
        $telerik.addExternalHandler(element, "blur", function(e) {
            $get("debugDIV").innerHTML += "RadEditor loosed focus <br/>";
        });
        $telerik.addExternalHandler(element, "click", function(e) {
            $get("debugDIV").innerHTML += "You just clicked in the editor <br/>";
        });
 
 
    }
</script>
<div id="debugDIV"></div>


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
Phil
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or