ComponentOne WebEditor for ASP.NET: Working with Client-Side Script > Client-Side Methods

Client-Side Methods

The available client-side methods are listed in the following table:

 

Method

Description

executeCustomCommand(sCommandName)

Execute C1WebEditor command given by parameter commandName.

Available commands:
insert_form, insert_textarea, insert_textbox, insert_passwordfield, insert_hiddenfield, insert_listbox, insert_dropdown, insert_radiobox, insert_checkbox, insert_imagebutton, insert_submitbutton, insert_reset, insert_buttoninstable, insertTimeStamp
Full_Screen
WYSIWYG_Mode, Code_Mode, Split_Mode
Save
backcolor, forecolor
ShowTableBorders
SpellCheck
Word_Wrap
insertrow, deleterow, insertcolumn, deletecolumn, insertcell, deletecell, mergecell, splitcell
Cut, Copy, Paste
Italic, Bold, Underline, strikethrough
JustifyLeft, JustifyCenter, JustifyRight, JustifyFull
subscript, superscript
insertorderedlist, insertunorderedlist
undo, redo
Editlink, Unlink

applyBackColorForSelection(sBackColor)

Apply background color for current document selection.

applyClassNameForSelection(sClassName)

Apply class name for current document selection.

applyFontSizeForSelection(sFontSize)

Apply font size for current document selection.

applyFontForSelection(sFontName)

Apply font for current document selection.

applyFormatForSelection(sFormat)

Apply format for current document selection.

focus(restoreSelectedElement)

Sets focus to current content editable document in WYSIWYG mode, parameter restoreSelectedElement - optional.

canUndo()

Returns true if WebEditor can undo action.

canRedo()

Returns true if WebEditor can redo action.

canCopy()

Returns true if Copy action is allowed.

canPaste()

Returns true if Paste action is allowed.

doSpellcheck()

Run spell checking.

deleteSelectionContent()

Delete content of the current selection in the WYSIWYG editor.

save()

Save current document by uploading it to server.

selectElement(pElement)

Select element given by parameter pElement.

isSaved(bool)

Returns true if text is saved, otherwise returns false.

undoAction()

Undo action.

redoAction()

Redo action.

storedContent()

Returns previously stored HTML content.

storeContent()

Store current HTML Content to internal hidden field.

selectedElement()

Gets selected Document Object Model (DOM) element.

selectionTextContent()

Gets string with text content of the current selection in the WYSIWYG editor.

selectionHTMLContent()

Gets string with HTML content of the current selection in the WYSIWYG editor.

isCodeEditingMode()

Returns true if Code editing mode is active.

insertHTML(sHtmlText)

Insert HTML text at current position in WYSIWG document. Note that previous selected text will be deleted.

SelectionBookmark()

Gets current selection bookmark object that can be used as parameter for method MoveToSelectionBookmark (applies to the WYSIWYG editor).

moveToSelectionBookmark(aSelectionBookmark)

Restore previously saved selection (applies to WYSIWYG editor).

queryCommandState(sCommandName)

Returns state ("ENABLED", "CHECKED", "DISABLED") of the basic command given by parameter commandName.

queryCommandValue(sCommandName)

Returns value of the basic command given by parameter commandName. Returns null if command not enabled or not exists.

querySelectionClass()

Returns the class that is used by the currently selected element.

refreshPathSelector()

Refresh the state of the path selector and toolbar buttons.

UnLink()

Executes Unlink command.

EditLink()

Executes Editlink command.

CanUnLink()

Returns True if Unlink action is allowed.

CanEditLink()

Returns True if Editlink action is allowed.

showTagInspector

Call this method to show the Tag Inspector dialog box.

Example

The following example sets the background color for the selected text to red:

 

public void ApplyBackColorForSelection(string backColor)

// Apply background color for current document selection

aC1WebEditorObj.applyBackColorForSelection("red");


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.
￿