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

Is there a list of events that I can use with attachEventHandler ?

1 Answer 163 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 26 Nov 2010, 05:47 PM
On this page it says you can attach events such as

http://www.telerik.com/help/aspnet-ajax/editor_attacheventhandler.html

Is there an actual definitive list of events? I can't find one anywhere on the site or on google.

I'm hoping to use a textchanged event on my editor. At the moment I am using onkeydown but it's possible to change text by highlighting it and pressing a button such as bold.

This is so I can check if the user has unsaved changes before navigating away from the page.

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 30 Nov 2010, 03:45 PM
Hi Simon,

RadEditor's attachEventHandler() method attaches a standard DOM event to the editor's content area element. You can find a list of the standard DOM events in the following article:
http://en.wikipedia.org/wiki/DOM_events

To achieve the required functionality you can use RadEditor's set_initalContent() and get_initialContent() methods and MS AJAX Framework Unload event, e.g.:
<telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad">
</telerik:RadEditor>
 
<script type="text/javascript">
    function OnClientLoad(editor, args)
    {
        editor.set_initialContent();//store the initial content
    }
 
    Sys.Application.add_unload(function ()
    {
        var editor = $find("<%=RadEditor1.ClientID %>");
 
        if (editor.get_initialContent() != editor.get_html(true))//check if the initial content matches current content
        {
            alert("Content has been changed");
        }
    })
</script>

I hope this helps.

Kind regards,
Dobromir
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Editor
Asked by
Simon
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or