BiRichEdit

This control is used to to provide rich text editing of HTML documents

This class extends BiIframe and therefore all methods and fields available for BiIframe are also available for BiRichEdit .

Constructor

new BiRichEdit ( )

Parameters

No parameters.

Properties

NameTypegetsetDescripton
captureTabbooleancheckedcheckedWhether the rich editor should capture tab keypresses. Defaults to false.
contentHtmlStringcheckedcheckedThe HTML code inside the rich editor frame. This does not include the doctype nor any comments outside the root element.
tabHtmlStringcheckedcheckedThe html code to insert when a tab is entered. Defaults to tabWidth *  
tabWidthNumbercheckedcheckedWidth to use for tabs. A tab will be replaced by tabWidth *  . Defaults to 4.

Methods

NameDescription
addCssRuleAdds a CSS rule to the content document
execCommandExecutes a command on the rich text editor. For a list of supported commands see MSDN. The method returns true if the command was successful.
insertHtmlInserts html at the current caret position
queryCommandEnabledReturns a boolean value that tells whether the given command will succeed if executed.
queryCommandStateReturns a boolean value that represents the state of the given command.
queryCommandValueReturns the current value for the given command.
removeCssRuleRemoves all CSS rules that matches the given selector

Events

None.

Static Methods

None.

Static Fields

None.

Remarks

Do not confuse the command methods with the BiCommand Bindows command concept. The command methods are used to change the content of the editor.

Method Details

addCssRule

Adds a CSS rule to the content document

Syntax

object.addCssRule ( sSelector,sStyle )

Parameters

NameTypeOptionalDefaultDescripton
sSelectorStringThe selector describing which elements the rule applies to
sStyleStringThe CSS text describing the style of the rule.

Return Type

void

execCommand

Executes a command on the rich text editor. For a list of supported commands see MSDN. The method returns true if the command was successful.

Syntax

object.execCommand ( sCommand [ ,bUi [ ,oCommandValue ] ] )

Parameters

NameTypeOptionalDefaultDescripton
sCommandStringThe command to execute
bUiBooleancheckedfalse Whether to show a dialog where extra arguments can be entered
oCommandValueObjectcheckedSome commands takes an argument. In those cases this argument is used

Return Type

Boolean

insertHtml

Inserts html at the current caret position

Syntax

object.insertHtml ( sHtml )

Parameters

NameTypeOptionalDefaultDescripton
sHtmlStringHtml to insert

Return Type

void

queryCommandEnabled

Returns a boolean value that tells whether the given command will succeed if executed.

Syntax

object.queryCommandEnabled ( sCommand )

Parameters

NameTypeOptionalDefaultDescripton
sCommandStringThe command to check whether enabled

Return Type

Boolean

queryCommandState

Returns a boolean value that represents the state of the given command.

Syntax

object.queryCommandState ( sCommand )

Parameters

NameTypeOptionalDefaultDescripton
sCommandStringThe command to get the state for

Return Type

Boolean

queryCommandValue

Returns the current value for the given command.

Syntax

object.queryCommandValue ( sCommand )

Parameters

NameTypeOptionalDefaultDescripton
sCommandStringThe command to get the value for

Return Type

Object

removeCssRule

Removes all CSS rules that matches the given selector

Syntax

object.removeCssRule ( sSelector )

Parameters

NameTypeOptionalDefaultDescripton
sSelectorStringThe selector describing which rules to remove.

Return Type

void