Smart Document Editor

(part of package 'smartDocumentEditor') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent

This is a reference page; many components have detailed usage guides here.

Properties

dataProviderID

Type: dataprovider


editorStyleSheet

Attach a style sheet to add or overwrite content styles used by the editor. Make sure to prefix all classes with the .ck-content class.

Type: media


language

Type: string Default Value: null


mentionFeeds

Type: mentionFeed[]


minHeight

Editor's min height. It's none by default. So when you want the height to be resposive and would like to have a min height for the editor, set responsiveHeight as 0 and this property with the value that fits your needs.

Type: int Default Value: null


overWriteTabForEditor

Type: boolean Default Value: true


readOnly

Type: protected Default Value: false


responsiveHeight

Editor's height to be set in a responsive form. When responsiveHeight is set to 0, the editor will use 100% height of the parent container. When value is set to -1 it will be based on the content.

Type: int Default Value: 500


showInspector

Type: boolean Default Value: false


showToolbar

Type: boolean Default Value: true


styleClass

Type: styleclass


toolbarItems

Configure toolbar items

Type: toolbarItem[]


viewType

Type: string Default Value: "DOCUMENT"


visible

Type: visible


Events

onActionMethodID

Parameters:

event JSEvent


onDataChangeMethodID

Parameters:

oldValue ${dataproviderType} newValue ${dataproviderType} event JSEvent

Returns: boolean


onError

Parameters:

errorMessage string errorStack string


onFileUploadedMethodID

Parameters:

file object


onFocusGainedMethodID

Parameters:

event JSEvent


onFocusLostMethodID

Parameters:

event JSEvent


onReady


API

addInputAtCursor

Add input to current cursor position, will return false when in readOnly mode

@example

elements.myElement.addInputAtCursor(input);

@param {String} input @return {Boolean}

Parameters:

input string

Returns: boolean


addTagAtCursor

Add tag to current cursor position, will return false when in readOnly mode

@example

elements.myElement.addTagAtCursor(tag);

@param {String} marker @param {String} tag @return {Boolean}

Parameters:

marker string tag string

Returns: boolean


create

(Re-)Creates the editor using the given config

@example

elements.myElement.create(config, onSuccess, onError);

@param {*} config

Parameters:

config object


createToolbarItem

Returns a toolbarItem that can be provided as one of the toolbar items on a toolbar property of an editor's config

@param {String} name the (unique) name of this toolbar item @param {Function} onClick the callback method to fire when the item is clicked @example

elements.myElement.createToolbarItem(name, onClick);

@return {CustomType<smartdocumenteditor-smartdocumenteditor.toolbarItem>}

Parameters:

name string onClick function

Returns: toolbarItem


executeCommand

Executes the specified command with given parameters.

@example

elements.myElement.executeCommand(command, commandParameters);

@param {String} command the name of the command to execute @param {*} [commandParameters] optional command parameters

Parameters:

command string commandParameters object (optional)


getCSSData

Parameters:

filterStylesheetName string (optional)

Returns: string


getHTMLData

Parameters:

withInlineCSS boolean (optional) filterStylesheetName string (optional)

Returns: string


getPrintCSSData

Returns: string


insertImage

Executes the specified command with given parameters.

@example

elements.myElement.executeCommand(command, commandParameters);

@param {String} command the name of the command to execute @param {*} [commandParameters] optional command parameters

Parameters:

source string


isInPreviewMode

Return if editor is in preview mode (CKEditor readOnly)

@return boolean @public

Returns: boolean


previewHTML

Preview Editor HTML data into the editor

@param {String} html @param {Boolean} [readOnly] set component into readOnly mode (default: true) @public

Parameters:

html string readOnly boolean (optional)


requestFocus

Request the focus to this editor.

@example

myElement.requestFocus();

saveData

Force the autosave trigger of the editor to get all latest changes

@example

dataprovider = elements.myElement.saveData();

@return {Object} the data currently in the editor.

Returns: object


setMentionFeeds

@param {Array<CustomType<smartdocumenteditor-smartdocumenteditor.mentionFeed>>} mentionFeeds @public

Parameters:

mentionFeeds mentionFeed[]


undoPreviewHTML

Undo Preview Editor HTML data into the editor

@param {Boolean} [readOnly] set component into readOnly mode (default: false) @public

Parameters:

readOnly boolean (optional)


Types

mentionFeed

scripting type: CustomType<smartdocumenteditor-smartdocumenteditor.mentionFeed>

mentionFeedItem

scripting type: CustomType<smartdocumenteditor-smartdocumenteditor.mentionFeedItem>

toolbar

scripting type: CustomType<smartdocumenteditor-smartdocumenteditor.toolbar>

toolbarItem

scripting type: CustomType<smartdocumenteditor-smartdocumenteditor.toolbarItem>


Last updated