Using editor.AttachEvent Method

Rich Text Editor for PHP

The editor.AttachEvent( ) method requires two parameters:

editor.AttachEvent("event", functionReference);

The event parameter is the "on" version of the event name, while the function reference is just like the kind you assign to an object event handler property. The combination of AttachEvent( ) and DetachEvent( ) allows scripts to enable and disable scripted functionality as desired.

Example:

<script type='text/javascript'>
function RichTextEditor_OnLoad(editor)
{
	editor.AttachEvent("TextChanged",function()
	{
	});
	editor.AttachEvent("ExecCommand",function()
	{
	});
}
</script>
Event Description
Load This event is invoked immediately after the RichTextEditor is fully loaded.

Example:

<script type='text/javascript'>
function RichTextEditor_OnLoad(editor)
{
	editor.AttachEvent("Load",function()
	{
	});
}
</script>
Dispose This event occurs immediately when a RichTextEditor is removed successfully.

Example:

<script type='text/javascript'>
function RichTextEditor_OnLoad(editor)
{
	editor.AttachEvent("Dispose",function()
	{
	});
}
</script>
TextChanged This event is raised if the content of RichTextEditor is changed.

Example:

<script type='text/javascript'>
function RichTextEditor_OnLoad(editor)
{
	editor.AttachEvent("TextChanged",function()
	{
	});
}
</script>
SelectionChanged This event is raised if the actual selection in the editor area changes.

Example:

<script type='text/javascript'>
function RichTextEditor_OnLoad(editor)
{
	editor.AttachEvent("SelectionChanged",function()
	{
	});
}
</script>
TabModeChanged This event is raised when switching between edit, code, and preview mode.

Example:

<script type='text/javascript'>
function RichTextEditor_OnLoad(editor)
{
	editor.AttachEvent("TabModeChanged",function()
	{
	});
}
</script>
UpdateUI This event is raised when the editor updates the user interface state.

Example:

<script type='text/javascript'>
function RichTextEditor_OnLoad(editor)
{
	editor.AttachEvent("UpdateUI",function()
	{
	});
}
</script>
PasteFilter This event is raised before the data is pasted into RichTextEditor. It allows you intercept the paste function and filter the content being pasted.
InitEvent This event is raised after the iframe document of the editor is reset. You can use it to initialize the iframe document or attach events to the DOM in iframe.
UninitEvent This event is raised before the iframe document of the editor is reset. You can use it to dispose all registered DOM elements before InitEvent occurs.
PreCut This event is raised when starting to copy content in the editor. If ReturnValue=false, the action is canceled.
PreCopy This event is raised when starting to cut content in the editor. If ReturnValue=false, the action is canceled.
ExecCommand This event is raised when ExecCommand is executed.
ExecUICommand This event is raised when ExecUICommand is executed.
FullScreenChanged This event is raised when switching to fullscreen mode.

Send feedback about this topic to CuteSoft. © 2003 - 2012 CuteSoft Components Inc. All rights reserved.