RadEditor for ASP.NET AJAX

RadControls for ASP.NET AJAX

RadEditor offers the following methods on the client-side:

 

Method name

Description

Returns a reference to RadEditor's client object

get_document()

Returns a reference to the RadEditor's content area document object

get_contentArea()

Returns a reference to the RadEditor's content area

get_textArea()

Returns a reference to the RadEditor's TextArea in Html mode

fire()

Executes RadEditor commands.

attachEventHandler()

Attaches an event to RadEditor.

detachEventHandler()

Detaches an event handler.

createRestorePoint() - obsolete

You can store and restore the exact position of the cursor using createRestorePoint and select method. Use getSelection().getRange()instead of the obsolete createRestorePoint()

editor.get_element().style.height

To get the height of the editor, first get the editor's HTML element, then retrieve the style.height

editor.get_element().style.width

To get the width of the editor, first get the editor's HTML element, then retrieve the style.width

get_html(true)

Returns the editor content as HTML. If the bool parameter is set to true, the returned HTML content will be modified by the RadEditor client filters

get_text()

Returns the editor content as plain text.

pasteHtml()

Pastes HTML content to the cursor position.

set_html()

Replaces the current content with a new one.

getSelectionHtml()

Returns the HTML of the selection.

Returns the current editor's mode

set_mode()

Sets RadEditor to Html, Preview or Design mode

setFocus()

Sets the focus on RadEditor.

set_visible()

Sets the RadEditor visible on the client.

setSize()

Sets the width and height of the RadEditor.

getToolByName()

Returns tool so for the purposes of client-side manipulation.

To open a custom editor's dialog use the showExternalDialog() method

add_submit()

Performs submit operation - sends all content to the server.

getSelection()

Returns a reference to the current RadEditorSelection object.

getSelection.getText()

Returns the currently selected content as plain text in the Telerik RadEditor ContentArea.

getSelection.getHtml()

Returns the currently selected html in the Telerik RadEditor ContentArea.

getSelection.getParentElement()

Returns a reference to the currently selected HTML element in the editor's content area.

getSelectedElement()

Returns a reference to the currently selected HTML element in the editor's content area.

set_useClassicDialogs(isModal)

Specifies whether RadEditor will use RadWindow windows or browser popup windows for its dialogs. If the parameter is set to true the editor will use the browser windows.

Client-Side Events:

 

Client-Size Events

Description

OnClientInit

This event is fired before the initialization of the editor's content area. You can use this method to override the editor's methods, filters, etc. This event prior to the OnClientLoad event.

OnClientLoad

This event is fired after the content is set in the content area, after the OnClientInit event and just before the editor is ready for use.

OnClientCommandExecuting

This event is fired just before a command is executed.

OnClientCommandExecuted

This event is fired after a command is executed.

OnClientPasteHtml

This event is useful in scenarios where the developers need to examine or modify the HTML to be pasted by an editor tool before it is inserted in the editor content area.

OnClientSelectionChange

This event signals that the selection within the editor content area has changed.