class DocumentEditor

Extends:
UIComponent

Description:

DocumentEditor UI component that extends UIComponent class.
DocumentEditor is a text editor that can be switched to HTML mode to display or edit an HTML styled page. Only HTML 3.2 is supported. Modern tags like in HTML5 are not supported and may be ignored. HTML page can be styles with CSS but CSS support is also limited.
Editing the HTML page is not great, but may be enough for basic purposes. CSS can be added to the document separately by setCSS() and addCSS() methods, or it can be embedded into the HTML content using style tags.

For more methods for this component check UIComponent class.

Constructor

constructor([content])

DocumentEditor constructor. Check usage examples below

Parameters:

Name Type Description

[content]

string

Initial content.

Members

Methods

From this class:

Inherited from UIComponent:

Examples:

let content = "<html><body><h1>This is a header</h1><p>This is a new paragraph</p></body></html>";
const editor1 = new DocumentEditor(content).html(true); // creates editor and sets content in constructor
const editor2 = new DocumentEditor().html(true).text(content); // creates editor and then sets content