This sample demonstrate the usage of API in Rich Text Editor, use the properties panel to change the maximum length, read only mode, disable status, to get value, enable HTML encode, select all content and get selected HTML from the Rich Text Editor.
Rich Text Editor is a WYSIWYG editing control that will reduce the effort for users while trying to express their formatting word content as HTML or Markdown format.
API’s:
maxLength - allows restricting the maximum length to be entered.
readOnly - allows to change it as a non-editable state.
enabled - enable or disable the RTE control.
enableHtmlEncode - Get the encoded string value through value property and source code panel
getValue - get the value of RTE.
getSelection - get the selected text of RTE.
selectAll - select all content in RTE.
Maximum Length
|
|
ReadOnly
|
|
Enabled
|
|
Enable Html Encode
|
|
|
|
|
|
|
In this demos, Ensuring the API'S behavious by doing Change the value of maxLength textbox to change maximum Length of character. Click the readOnly check box to enable/disable editable and non-editable mode of the RTE. Click the enabled check box to enable/disable the RTE control. Click the enableHtmlEncode check box to enableHtmlEncode/disableHtmlEncode the RTE control. Click the getValue button which shows the RTE values in the alert window. Click the getSelection button which shows the selectedText in the alert window. Click the selectAll button selecting all text content in the RTE. Injecting Module The above features built as modules have to be included in your application. For example, to use image and link, inject the specific module using RichTextEditor.Inject (Toolbar, Link, Image, Count, HtmlEditor, QuickToolbar, PasteCleanup).