Editor Blazor API

Editor Properties

NameTypeDefaultDescription
AutoLoadboolfalseAutomatically loads the last saved state of the editor (from local storage) on element initialization. An id must be provided in order to load a previously saved state.
AutoSaveboolfalseAutomatically saves the current content of the editor. Saving happens at time intervas determined by the autoSaveInterval property while the element on focus. An id must be provided to the element in order to store the state.
AutoSaveIntervalint1000The property that determines the interval to automatically save the state of the Editor when the autoSave property is set.
CharCountFormatFunctionobjectN/AA formatting function for the char counter. Takes two arguments:
  • chars - the current number of characters inside the Editor.
  • maxCharCount - the maximum number of characters inside the Editor.
ContentFilteringEditorContentFilteringN/ADetermines the content filtering settings.
ContextMenuEditorContextMenuEditorContextMenu.DefaultDetermines the context menu for the Editor. The context menu is triggered when the user right clicks on the content area of the Editor.
ContextMenuDataSourceIEnumerable<object>N/AAllows to customize default the context menu of the Editor. The property accepts an array of items which can be strings that represent the value of the item, or objects of the following format: { label: string, value: string }, where the label will be displayed and the value will be action value for the item. The property also accepts a function that must return an array of items with the following format function (target: HTMLElement, type: string, defaultItems: string[]) { return defaultItems } and the following arguments:
  • target - the element that is the target of the context menu.
  • type - the type of context menu ( whether it's a table, image, link or other)
  • defaultItems - an array of strings which represent the default items for the context menu.
DataExportEditorDataExportN/ASets the Editor's Data Export options.
DisabledboolfalseEnables or disables the Editor.
DisableEditingboolfalseDisables content editing inside Editor.
DisableSearchBarboolfalseDisables the Quick Search Bar.
EditModeEditModeEditMode.HtmlDetermines the edit mode for the Editor. By default the editor's content accepts and parses HTML. However if set to 'markdown' the Editor can be used as a full time Markdown Editor by parsing the makrdown to HTML in preview mode.
EnableHtmlEncodeboolfalseDetermines whether the value returned from getHTML method and Source Code view are encoded or not.
EnableTabKeyboolfalseDetermines whether the Tab key can insert tab chars inside the Editor or change focus (default)
FindAndReplaceTimeoutint50Determines the time interval between results for the find and replace and search bar features.
HideToolbarboolfalseDetermines whether the Toolbar is hidden or not.
HideInlineToolbarboolfalseDetermines whether the Inline Toolbar is hidden or not.
ImageFormatEditorImageFormatEditorImageFormat.Base64Determines the file format of the image/video that are uploaded from local storage. By default images/videos are stroed as base64.
InnerHTMLstring"en"Sets the content of the Editor as HTML. Allows to insert text and HTML.
InlineToolbarOffsetint[]new int[]{}Defines an offset(x,y) for the Inline Toolbar positioning on the page.
IframeSettingsEditorIframeSettingsN/ADetermines the iframe settings of the Editor. When enabled the contents of the Editor are placed inside an iframe, isolated in a separate dom. The element allows to insert external resources into the iframe if needed.
Localestring"en"Sets or gets the language. Used in conjunction with the property messages.
MaxCharCountintN/ASets a limit on the number of chars inside the Editor.
MessagesobjectN/ASets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property language.
Namestring"null"Sets a to the element which can be used to submit the value of the Editor via a form.
PasteFormatPasteFormatPasteFormat.KeepFormatDetermines the format of the content that will be pasted inside the Editor.
Placeholderstring""Determines the placeholder that will be shown when there's no content inside the Editor.
RemoveStylesOnClearFormatboolfalseDetermines whether the clearFormat toolbar action should also remove inline styles from the currently selected node.
RequiredboolfalseDetermines whether Editor's content is required ot not. If set and the Editor's content is empty, a notification will appear to notify that the Editor cannot be empty.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
SanitizedboolfalseDetermines whether the value is sanitized from XSS content or not. When enabled scripts and other XSS vulnerabilities are not allowed to exist inside the Editor's as HTML content.
ShowCharCountboolfalseDetermines whether the char counter is visible or not. When enabled it is displayed in the bottom right corner. If maxCharCount is set and the content characters are equal or more than 70% of the maximum char count the counter is colored in order to warn the user. If the char count is equal or more than 90% the counter is again colored with a different warning color to indicate that the counter is near maximum. When maximum is reached, text input is not allowed.
SplitModeRefreshTimeoutint100Determines the refresh interval for the Source Code/Preview Panel when Split Mode is enabled.
Themestring""Determines the theme. Theme defines the look of the element
ToolbarItemsIEnumerable<IEditorToolbarItem>N/ADetermines the Toolbar items list. Each item can be string pointing to the name of the item or an object that defines a custom item or adds aditional settings to an item. The name of the items are case insensitive. An object definition should contain a name attribute that refers to the name of the item when modifing an existing toolbar item. The name attribute determines the action of the item. If set to 'custom' it is possible to create a custom toolbar item. If name attribute is not set or not valid it is treated as a separator, no a toolbar item. The following items are supported by default by the Editor:
  • SourceCode - shows the HTML/Preview Panel by hiding the input panel. Item type - 'Toggle button'.
  • SplitMode - shows both input and HTML/Preview Panel by splitting the Editor content in two sections. Item type - 'Toggle button'
  • FullScreen - fits the viewport with the Editor by expanding it over the page content. Item type - 'Toggle button'.
  • Alignment - aligns the selected content. Item type - 'Drop down'.
  • FontName - changes the font family of the selected content. Item type - 'drop-down'.
  • FontSize - changes the font size of the selected content. Item type - 'drop-down'.
  • Formats - changes the format of the current selection. Itme type - 'drop-down'.
  • TableRows - allows to insert/remove a row into a selected table element. Item type - 'drop-down'.
  • TableColumns - allows to insert/remove a column into a selected table element. Itme type - 'drop-down'.
  • TableVAlign - sets the vertical alignment of a selected table cell. Item type - 'drop-down'.
  • TableStyle - sets additional styling to a selected table inside the Editor. Item type - 'drop-down'.
  • BackgroundColor - changes the background color of the current selection. Item type - 'color-input'.
  • FontColor - changes the font color of the current selection. Item type = 'color-input'.
  • Bold - sets the currently selected text as bold or not. Item type - 'button'.
  • Italic - sets the currently selected text as italic. Item type - 'button'.
  • Underline - sets the currently selected text as underlined. Itme type - 'button'.
  • Strikethrough - set the currently selected text as strikethrough. Item type - 'button'.
  • Delete - deletes the current selection. Item type - 'button'.
  • Undo - undoes the last operation. Item type - 'button'.
  • Redo - redoes the previous operation. Item type - 'button'.
  • Indent - indents the current selection once. Item type - 'button'.
  • Outdent - outdents the current selection once. Item type - 'button'.
  • OpenLink - triggers a hyperlink. Item type - 'button'.
  • EditLink - creates/edits the selected hyperlink. Item type - 'button'.
  • CreateLink - creates/edits the selected hyperlink. Item type - 'button'.
  • RemoveLink - removes the currently selected hyperlink. Item type - 'button'.
  • Hyperlink - same as createLink, triggers a Dialog Window for link creation. Item type - 'button'.
  • Cut - Cuts the currently selected text. Item type - 'button'.
  • Copy - copies the currently selected text. Item type - 'button'
  • Paste - pastes the currenly copied/cut text from the Clipboard. Item type = 'button' or 'drop-down' when advanced attribute is set to 'true'.
  • Image - triggers a Dialog Window to insert/edit an image. Item type - 'button'.
  • Video - triggers a Dialog Window to insert/edit a video. Item type - 'button'.
  • LowerCase - changes the current selection to lower case. Item type - 'button'.
  • UpperCase - changes the current selection to upper case. Item type - 'button'.
  • Print - opens the browser print preview window. Item type - 'button'.
  • Caption - insert/remove a caption when a table is selected. Item type - 'button'.
  • ClearFormat - removes the formatting of the currntly selected text. Item type - 'button'.
  • Table - triggers a Dialog Window to insert a table. Item type - 'button'.
  • TableHeader - insert/remove a header row to the currently selected table. Item type - 'button'.
  • OrderedList - insert/remove an order list. Item type = 'button'.
  • UnorderedList - insert/remove an unordered list. Item type - 'button'.
  • Subscript - changes the currently selected text to subscript. Item type - 'button'.
  • Superscript - changes the currently selected text to superscript. Item type - 'button'.
  • FindAndReplace - opens a dialog that allows to find and replace text inside the Editor's content section. Item type - 'button'.

The inlineToolbarItems attribute is applicable only to the following items: 'table', 'image', 'hyperlink'. It accepts the same type of value as toolbarItems property but the toolbar items will be placed insinde the Inline Toolbar instead.
ToolbarModeToolbarModeToolbarMode.MenuDetermines the toolbar mode of the Editor. The main toolbar of the Editor can appear as a Ribbon or as a Menu.
ToolbarRibbonConfigIEnumerable<object>[{"name":"homeTab","groups":[{"name":"undoGroup","items":["undo","redo"]},{"name":"clipboardGroup","items":["cut","copy","paste"]},{"name":"fontGroup","items":["fontName","fontSize","backgroundColor","fontColor","clearFormat","formats","bold","italic","underline","strikethrough","superscript","subscript"]},{"name":"paragraphGroup","items":["orderedList","unorderedList","indent","outdent","alignment"]},{"name":"editingGroup","items":["findAndReplace"]}]},{"name":"insertTab","groups":[{"name":"tableGroup","items":["table"]},{"name":"imageGroup","items":["image"]}{"name":"videoGroup","items":["video"]},{"name":"linkGroup","items":["createLink","removeLink"]}]},{"name":"viewTab","groups":[{"name":"viewsGroup","items":["fullScreen","sourceCode","splitMode"]}]},{"name":"layoutTab","hidden":true,"groups":[{"name":"deleteGroup","items":["delete"]},{"name":"tableGroup","items":["table","tableHeader","tableRows","tableColumns","tableVAlign","tableStyle",""]},{"name":"imageGroup","items":["image","caption"]},{"name":"videoGroup","items":["video","caption"]}]}]Allows to configure the SingleLineRibbon appearance by changing the order and items of the groups.
ToolbarViewModeToolbarViewModeToolbarViewMode.ToggleDetermines the format of the content that will be pasted inside the Editor.
ToolbarStickyboolfalseSticks the Toolbar to the top of the window and stays there while scrolling.
UnfocusableboolfalseIf is set to true, the element cannot be focused.
Valuestring""Sets or gets the value of the Editor.
WindowCustomizationFunctionobjectN/AA function that can be used to completly customize the Editor dialog that is used to insert/edit tables/images/videos/hyperlinks. The function accepts two arguments:
  • target - the target dialog that is about to be opened.
  • item - the toolbar item object that trigger the dialog.

Editor Methods

NameTypeArgumentsDescription
ClearContentvoidN/AClears the content of the Editor.
ClearStatevoidN/AClears the local storage from previously stored states of the Editor with the current id.
CollapseToolbarvoidN/ACollapse the Toolbar if the <b>toolbarViewMode</b> is set to 'toggle'.
DisableToolbarItemvoidstring itemNameDisables a Toolbar item.Args: string itemName - The name of the toolbar item to disable.
EnableToolbarItemvoidstring itemNameEnables a previously disabled Toolbar item.Args: string itemName - The name of the toolbar item to enable.
ExecuteCommandboolstring commandName, object valueExecutes a command via the native <b>execCommand</b> method. The method returns true or false depending on whether the execution was successful or not. The following list of commands can be eexecuted: <ul><li>bold - makes the currently selected content bold. Example: <b>editor.executeCommand('bold');</b></li><li>italic - makes the currently selected content italic. Example: <b>editor.executeCommand('italic');</b></li><li>undelined - makes the currently selected content underlined. Example: <b>editor.executeCommand('underline');</b></li><li>strikeThrough - applies a single line strike through formatting to the currently selected content. Example: <b>editor.executeCommand('strikeThrough');</b></li><li>superscript - sets the selected content as superscript. Example: <b>editor.executeCommand('superscript');</b></li><li>subscript - sets the selected content as superscript. Example: <b>editor.executeCommand('subscript');</b></li><li>uppercase - changes the case of the current selection to upper. Example: <b>editor.executeCommand('uppercase');</b></li><li>lowercase - changes the case of the current selection to lower. Example: <b>editor.executeCommand('lowercase');</b></li><li>foreColor - changes the font color of the current content selection. Example: <b>editor.executeCommand('foreColor', '#000000');</b></li><li>fontName - changes the font name for the selected content. Example: <b>editor.executeCommand('fontName', 'Arial');</b></li><li>fontSize - changes the font size of the currently selected content. Example: <b>editor.executeCommand('fontSize', '15px');</b></li><li>hiliteColor - changes the background color of current selection. Example: <b>editor.executeCommand('hiliteColor', '#000000');</b></li><li>justifyCenter - aligns the content to the center. Example: <b>editor.executeCommand('justifyCenter');</b></li><li>justifyFull - aligns the content to be fully justified. Example: <b>editor.executeCommand('justifyFull');</b></li><li>justifyLeft - aligns the content to the left. Example: <b>editor.executeCommand('justifyLeft');</b></li><li>justifyRight - aligns the content to the right. Example: <b>editor.executeCommand('justifyRight');</b></li><li>undo - allows to undo the previous action. Example: <b>editor.executeCommand('undo');</b></li><li>redo - allows to redo the previous actions. Example: <b>editor.executeCommand('redo');</b></li><li>createLink - creates a hyperlink in the content section of the Editor. Example: <b>editor.executeCommand('createLink', { text: 'Links', url: 'http://', title : 'Link' });</b></li><li>indent - indents the content with one level. Example: <b>editor.executeCommand('indent');</b></li><li>outdent - outdents the content with one level. Example: <b>editor.executeCommand('outdent');</b></li><li>insertHTML - insert an HTML content as string at the current cursor location. Example: <b>editor.executeCommand('insertHTML', '<p>Text</p>');</b></li><li>insertOrderedList - inserts a new numbered list item. Example: <b>editor.executeCommand('insertOrderedList');</b></li><li>insertUnorderedList - inserts a new bulleted list item. Example: <b>editor.executeCommand('insertUnorderedList');</b></li><li>removeFormat - removes the formatting styles from currently selected text. Example: <b>editor.executeCommand('removeFormat');</b></li><li>insertText - inserts a text at the current cursor location. Example: <b>editor.executeCommand('insertText', 'Some text to insert');</b></li><li>insertImage - inserts an image at the current cursor location. Example: <b>editor.executeCommand('insertImage', { url: 'https://www.htmlelements.com/demos/images/carousel-medium-2.jpg'});</b></li></ul>Args: string commandName - The name of the command to execute.,string value - The value for the command. Some commands require a value to be passed, others do not.
ExecuteCommandboolstring commandNameExecutes a command via the native execCommand method. The method returns true or false depending on whether the execution was successful or not. The following list of commands can be eexecuted:
  • bold - makes the currently selected content bold. Example: editor.executeCommand('bold');
  • italic - makes the currently selected content italic. Example: editor.executeCommand('italic');
  • undelined - makes the currently selected content underlined. Example: editor.executeCommand('underline');
  • strikeThrough - applies a single line strike through formatting to the currently selected content. Example: editor.executeCommand('strikeThrough');
  • superscript - sets the selected content as superscript. Example: editor.executeCommand('superscript');
  • subscript - sets the selected content as superscript. Example: editor.executeCommand('subscript');
  • uppercase - changes the case of the current selection to upper. Example: editor.executeCommand('uppercase');
  • lowercase - changes the case of the current selection to lower. Example: editor.executeCommand('lowercase');
  • foreColor - changes the font color of the current content selection. Example: editor.executeCommand('foreColor', '#000000');
  • fontName - changes the font name for the selected content. Example: editor.executeCommand('fontName', 'Arial');
  • fontSize - changes the font size of the currently selected content. Example: editor.executeCommand('fontSize', '15px');
  • hiliteColor - changes the background color of current selection. Example: editor.executeCommand('hiliteColor', '#000000');
  • justifyCenter - aligns the content to the center. Example: editor.executeCommand('justifyCenter');
  • justifyFull - aligns the content to be fully justified. Example: editor.executeCommand('justifyFull');
  • justifyLeft - aligns the content to the left. Example: editor.executeCommand('justifyLeft');
  • justifyRight - aligns the content to the right. Example: editor.executeCommand('justifyRight');
  • undo - allows to undo the previous action. Example: editor.executeCommand('undo');
  • redo - allows to redo the previous actions. Example: editor.executeCommand('redo');
  • createLink - creates a hyperlink in the content section of the Editor. Example: editor.executeCommand('createLink', { text: 'Links', url: 'http://', title : 'Link' });
  • indent - indents the content with one level. Example: editor.executeCommand('indent');
  • outdent - outdents the content with one level. Example: editor.executeCommand('outdent');
  • insertHTML - insert an HTML content as string at the current cursor location. Example: editor.executeCommand('insertHTML', '

    Text

    ');
  • insertOrderedList - inserts a new numbered list item. Example: editor.executeCommand('insertOrderedList');
  • insertUnorderedList - inserts a new bulleted list item. Example: editor.executeCommand('insertUnorderedList');
  • removeFormat - removes the formatting styles from currently selected text. Example: editor.executeCommand('removeFormat');
  • insertText - inserts a text at the current cursor location. Example: editor.executeCommand('insertText', 'Some text to insert');
  • insertImage - inserts an image at the current cursor location. Example: editor.executeCommand('insertImage', { url: 'https://www.htmlelements.com/demos/images/carousel-medium-2.jpg'});
ExecuteCommandboolstring commandName, string valueExecutes a command via the native <b>execCommand</b> method. The method returns true or false depending on whether the execution was successful or not. The following list of commands can be eexecuted: <ul><li>bold - makes the currently selected content bold. Example: <b>editor.executeCommand('bold');</b></li><li>italic - makes the currently selected content italic. Example: <b>editor.executeCommand('italic');</b></li><li>undelined - makes the currently selected content underlined. Example: <b>editor.executeCommand('underline');</b></li><li>strikeThrough - applies a single line strike through formatting to the currently selected content. Example: <b>editor.executeCommand('strikeThrough');</b></li><li>superscript - sets the selected content as superscript. Example: <b>editor.executeCommand('superscript');</b></li><li>subscript - sets the selected content as superscript. Example: <b>editor.executeCommand('subscript');</b></li><li>uppercase - changes the case of the current selection to upper. Example: <b>editor.executeCommand('uppercase');</b></li><li>lowercase - changes the case of the current selection to lower. Example: <b>editor.executeCommand('lowercase');</b></li><li>foreColor - changes the font color of the current content selection. Example: <b>editor.executeCommand('foreColor', '#000000');</b></li><li>fontName - changes the font name for the selected content. Example: <b>editor.executeCommand('fontName', 'Arial');</b></li><li>fontSize - changes the font size of the currently selected content. Example: <b>editor.executeCommand('fontSize', '15px');</b></li><li>hiliteColor - changes the background color of current selection. Example: <b>editor.executeCommand('hiliteColor', '#000000');</b></li><li>justifyCenter - aligns the content to the center. Example: <b>editor.executeCommand('justifyCenter');</b></li><li>justifyFull - aligns the content to be fully justified. Example: <b>editor.executeCommand('justifyFull');</b></li><li>justifyLeft - aligns the content to the left. Example: <b>editor.executeCommand('justifyLeft');</b></li><li>justifyRight - aligns the content to the right. Example: <b>editor.executeCommand('justifyRight');</b></li><li>undo - allows to undo the previous action. Example: <b>editor.executeCommand('undo');</b></li><li>redo - allows to redo the previous actions. Example: <b>editor.executeCommand('redo');</b></li><li>createLink - creates a hyperlink in the content section of the Editor. Example: <b>editor.executeCommand('createLink', { text: 'Links', url: 'http://', title : 'Link' });</b></li><li>indent - indents the content with one level. Example: <b>editor.executeCommand('indent');</b></li><li>outdent - outdents the content with one level. Example: <b>editor.executeCommand('outdent');</b></li><li>insertHTML - insert an HTML content as string at the current cursor location. Example: <b>editor.executeCommand('insertHTML', '<p>Text</p>');</b></li><li>insertOrderedList - inserts a new numbered list item. Example: <b>editor.executeCommand('insertOrderedList');</b></li><li>insertUnorderedList - inserts a new bulleted list item. Example: <b>editor.executeCommand('insertUnorderedList');</b></li><li>removeFormat - removes the formatting styles from currently selected text. Example: <b>editor.executeCommand('removeFormat');</b></li><li>insertText - inserts a text at the current cursor location. Example: <b>editor.executeCommand('insertText', 'Some text to insert');</b></li><li>insertImage - inserts an image at the current cursor location. Example: <b>editor.executeCommand('insertImage', { url: 'https://www.htmlelements.com/demos/images/carousel-medium-2.jpg'});</b></li></ul>Args: string commandName - The name of the command to execute.,string value - The value for the command. Some commands require a value to be passed, others do not.
ExecuteCommandboolstring commandName, int valueExecutes a command via the native <b>execCommand</b> method. The method returns true or false depending on whether the execution was successful or not. The following list of commands can be eexecuted: <ul><li>bold - makes the currently selected content bold. Example: <b>editor.executeCommand('bold');</b></li><li>italic - makes the currently selected content italic. Example: <b>editor.executeCommand('italic');</b></li><li>undelined - makes the currently selected content underlined. Example: <b>editor.executeCommand('underline');</b></li><li>strikeThrough - applies a single line strike through formatting to the currently selected content. Example: <b>editor.executeCommand('strikeThrough');</b></li><li>superscript - sets the selected content as superscript. Example: <b>editor.executeCommand('superscript');</b></li><li>subscript - sets the selected content as superscript. Example: <b>editor.executeCommand('subscript');</b></li><li>uppercase - changes the case of the current selection to upper. Example: <b>editor.executeCommand('uppercase');</b></li><li>lowercase - changes the case of the current selection to lower. Example: <b>editor.executeCommand('lowercase');</b></li><li>foreColor - changes the font color of the current content selection. Example: <b>editor.executeCommand('foreColor', '#000000');</b></li><li>fontName - changes the font name for the selected content. Example: <b>editor.executeCommand('fontName', 'Arial');</b></li><li>fontSize - changes the font size of the currently selected content. Example: <b>editor.executeCommand('fontSize', '15px');</b></li><li>hiliteColor - changes the background color of current selection. Example: <b>editor.executeCommand('hiliteColor', '#000000');</b></li><li>justifyCenter - aligns the content to the center. Example: <b>editor.executeCommand('justifyCenter');</b></li><li>justifyFull - aligns the content to be fully justified. Example: <b>editor.executeCommand('justifyFull');</b></li><li>justifyLeft - aligns the content to the left. Example: <b>editor.executeCommand('justifyLeft');</b></li><li>justifyRight - aligns the content to the right. Example: <b>editor.executeCommand('justifyRight');</b></li><li>undo - allows to undo the previous action. Example: <b>editor.executeCommand('undo');</b></li><li>redo - allows to redo the previous actions. Example: <b>editor.executeCommand('redo');</b></li><li>createLink - creates a hyperlink in the content section of the Editor. Example: <b>editor.executeCommand('createLink', { text: 'Links', url: 'http://', title : 'Link' });</b></li><li>indent - indents the content with one level. Example: <b>editor.executeCommand('indent');</b></li><li>outdent - outdents the content with one level. Example: <b>editor.executeCommand('outdent');</b></li><li>insertHTML - insert an HTML content as string at the current cursor location. Example: <b>editor.executeCommand('insertHTML', '<p>Text</p>');</b></li><li>insertOrderedList - inserts a new numbered list item. Example: <b>editor.executeCommand('insertOrderedList');</b></li><li>insertUnorderedList - inserts a new bulleted list item. Example: <b>editor.executeCommand('insertUnorderedList');</b></li><li>removeFormat - removes the formatting styles from currently selected text. Example: <b>editor.executeCommand('removeFormat');</b></li><li>insertText - inserts a text at the current cursor location. Example: <b>editor.executeCommand('insertText', 'Some text to insert');</b></li><li>insertImage - inserts an image at the current cursor location. Example: <b>editor.executeCommand('insertImage', { url: 'https://www.htmlelements.com/demos/images/carousel-medium-2.jpg'});</b></li></ul>Args: string commandName - The name of the command to execute.,int value - The value for the command. Some commands require a value to be passed, others do not.
ExpandToolbarvoidN/AExpand the Toolbar if the <b>toolbarViewMode</b> is set to 'toggle'.
ExportDatavoidstring dataFormat, object callbackExports the content of the Editor in the desired format. The currently supported formats are: HTML, Markdown and PDF.Args: string dataFormat - The expected file format.,object callback - A callback that is executed before the data is exported. Allows to modify the output.
ExportDatavoidstring dataFormatExports the content of the Editor in the desired format. The currently supported formats are: HTML, Markdown and PDF.
FullScreenModevoidbool valueSets Editor into Full Screen Mode. If enabled the Editor is positioned above the page content and fills the screen.Args: bool value - Determines whether to enter or leave split mode. By default the argument is not passed and the mode is toggled.
FullScreenModevoidN/ASets Editor into Full Screen Mode. If enabled the Editor is positioned above the page content and fills the screen.
GetCharCountintN/AReturns the number of characters inside the Editor's content.
GetDataSourceAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;DataSource&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
GetHTMLstringN/AReturns the content of the Editor as HTML. When <b>editMode</b> is set to 'markdown' the markdown is parsed and returned as HTML.
GetSelectionRangeobjectN/AReturns the current selection range. By default the result is an object of type Range, but if the <b>editMode</b> property is set to 'markdown' the returned value is an object indicating the start/end indexes of the current selection.
GetTextstringN/AReturns the content of the Editor as text.
GetValueAsync()Task<string>'N/A'Gets the &quot;Value&quot; property as Task&lt;string&gt;.
HideLastMessagevoidN/AHides the last shown message.
HideMessagevoidobject itemHides a specific message or all messages if no argument is provided.Args: object item - Hides a specific message. The argument can be a DOM reference to a specific item, it's index or it's id. If the argument is not provided then all messages will be closed.
HideMessagevoidN/AHides a specific message or all messages if no argument is provided.
ImportDatavoidobject source, object settingsImports the content of a file to the Editor. The currently supported formats are: TXT or HTML.Args: object source - The url to the file or an object that defines settings for the Ajax request like url, timeput, etc. Object format: { url: string, type: string, data: object, timeout: number },object settings - Additional settings for the ajax request. Such as loadError function, contentType, etc. Format: { contentType: string, beforeSend: Function, loadError: Function, beforeLoadComplete: Function }
ImportDatavoidobject sourceImports the content of a file to the Editor. The currently supported formats are: TXT or HTML.
LoadStatevoidN/ALoads the last stored state of the Editor from local storage. Requires an id to be set to the Editor.
PreviewModevoidbool valueSets Editor into SourceCode/Preview Mode. In this mode the HTML view panel is displayed.Args: bool value - Determines whether to enter or leave split mode. By default the argument is not passed and the mode is toggled.
PreviewModevoidN/ASets Editor into SourceCode/Preview Mode. In this mode the HTML view panel is displayed.
PrintvoidN/AOpens the Print Preview Panel of the Browser to print Editor's content.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
SaveStatevoidN/ASaves the current state of the Editor to local storage. Requires an id to be set to the Editor.
SelectAllvoidN/ASelects the text inside Editor's content.
SelectRangevoidint startIndex, int endIndexSelects a range of text inside the Editor. The method will find the nodes containing the text from the start to the end indexes and will select them as ranges. However, currently only FireFox supports multiple range selection. The rest of the browsers will only select the first node. If the editor is in 'html' <b>editMode</b> then the expected text will be selected regardless of the browser because there's only one node inside the editor.Args: int startIndex - The start index to select from.,int endIndex - The end index to select to.
ShowMessageobjectstring message, object settingsShows a custom message inside the Editor.Args: string message - The text message to be displayed.,object settings - Additional settings that can be applied to the Toast element that handles the messages. This parameter should contain only valid Toast properties and values.
ShowMessageobjectstring messageShows a custom message inside the Editor.
SplitModevoidbool valueSets Editor into Split Mode. In split mode the HTML/Markdown editor and SourceCode/Preview panels are visible.Args: bool value - Determines whether to enter or leave split mode. By default the argument is not passed and the mode is toggled.
SplitModevoidN/ASets Editor into Split Mode. In split mode the HTML/Markdown editor and SourceCode/Preview panels are visible.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
UpdateToolbarItemobjectobject name, object settingsAllows to update the settings of a single toolbar item. The method returns <b>true</b> if successful.Args: string name - The name of the toolbar item or it's index inside the <b>toolbarItems</b> array.,object settings - A settings object for the toolbar item. It should have the same definition as when defining a custom toolbar item. You can read more about it in the dedicated topic for the Editor Toolbar on the website.

Editor Events

NameTypeDescriptionEvent Detail
OnChangeEventCallback<Event>This event is triggered on blur if the content is changed.dynamic oldValue- The old value before the change., dynamic value- The new value after the change.
Changedevent EditorChangedEventHandlerThis event is triggered on blur if the content is changed.EditorChangedEventArgs
OnChangingEventCallback<Event>This event is triggered after user input to indicate that the content is changed via user interaction.dynamic oldValue- The old value before the input change., dynamic value- The new value after the input change.
Changingevent EditorChangingEventHandlerThis event is triggered after user input to indicate that the content is changed via user interaction.EditorChangingEventArgs
OnActionStartEventCallback<Event>This event is triggered before a Toolbar action is started. The event can be canceled via event.preventDefault().dynamic name- The name of the action.
ActionStartedevent EditorActionStartedEventHandlerThis event is triggered before a Toolbar action is started. The event can be canceled via event.preventDefault().EditorActionStartedEventArgs
OnActionEndEventCallback<Event>This event is triggered when a Toolbar action has ended.dynamic name- The name of the action.
ActionEndedevent EditorActionEndedEventHandlerThis event is triggered when a Toolbar action has ended.EditorActionEndedEventArgs
OnContextMenuItemClickEventCallback<Event>This event is triggered when a Context menu item has been clicked.dynamic originalEvent- The original click event., dynamic value- The value of the item.
ContextMenuItemClickedevent EditorContextMenuItemClickedEventHandlerThis event is triggered when a Context menu item has been clicked.EditorContextMenuItemClickedEventArgs
OnContextMenuOpenEventCallback<Event>This event is triggered when the Context Menu is opened.dynamic target- The toolbar that is the target of the operation., dynamic owner- The tooltip target (the owner of the tooltip).
ContextMenuOpenedevent EditorContextMenuOpenedEventHandlerThis event is triggered when the Context Menu is opened.EditorContextMenuOpenedEventArgs
OnContextMenuOpeningEventCallback<Event>This event is triggered when the Context Menu is opening. The opening operation can be canceled via event.preventDefault().dynamic target- The toolbar that is the target of the operation.
ContextMenuOpeningevent EditorContextMenuOpeningEventHandlerThis event is triggered when the Context Menu is opening. The opening operation can be canceled via event.preventDefault().EditorContextMenuOpeningEventArgs
OnContextMenuCloseEventCallback<Event>This event is triggered when the Context Menu is closed.dynamic target- The toolbar that is the target of the operation., dynamic owner- The tooltip target (the owner of the tooltip).
ContextMenuClosedevent EditorContextMenuClosedEventHandlerThis event is triggered when the Context Menu is closed.EditorContextMenuClosedEventArgs
OnContextMenuClosingEventCallback<Event>This event is triggered when the Context Menu is closing. The closing operation can be canceled via event.preventDefault().dynamic target- The toolbar that is the target of the operation.
ContextMenuClosingevent EditorContextMenuClosingEventHandlerThis event is triggered when the Context Menu is closing. The closing operation can be canceled via event.preventDefault().EditorContextMenuClosingEventArgs
OnResizeStartEventCallback<Event>This event is triggered when an image/table/video resizing has started.N/A
ResizeStartedevent EditorResizeStartedEventHandlerThis event is triggered when an image/table/video resizing has started.EditorResizeStartedEventArgs
OnResizeEndEventCallback<Event>This event is triggered when an image/table/video resizing has ended.dynamic target- The element that is resized (image/table or video).
ResizeEndedevent EditorResizeEndedEventHandlerThis event is triggered when an image/table/video resizing has ended.EditorResizeEndedEventArgs
OnInlineToolbarOpenEventCallback<Event>This event is triggered when the inline Toolbar is opened.dynamic target- The toolbar that is the target of the operation., dynamic owner- The tooltip target (the owner of the tooltip).
InlineToolbarOpenedevent EditorInlineToolbarOpenedEventHandlerThis event is triggered when the inline Toolbar is opened.EditorInlineToolbarOpenedEventArgs
OnInlineToolbarOpeningEventCallback<Event>This event is triggered when the inline Toolbar is opening. The opening operation can be canceled by calling event.preventDefault() in the event handler function.dynamic target- The toolbar that is the target of the operation.
InlineToolbarOpeningevent EditorInlineToolbarOpeningEventHandlerThis event is triggered when the inline Toolbar is opening. The opening operation can be canceled by calling event.preventDefault() in the event handler function.EditorInlineToolbarOpeningEventArgs
OnInlineToolbarCloseEventCallback<Event>This event is triggered when the inline Toolbar is closed.dynamic target- The toolbar that is the target of the operation., dynamic owner- The tooltip target (the owner of the tooltip).
InlineToolbarClosedevent EditorInlineToolbarClosedEventHandlerThis event is triggered when the inline Toolbar is closed.EditorInlineToolbarClosedEventArgs
OnInlineToolbarClosingEventCallback<Event>This event is triggered when the inline Toolbar is closing.dynamic target- The toolbar that is the target of the operation. The closing operation can be canceled by calling event.preventDefault() in the event handler function.
InlineToolbarClosingevent EditorInlineToolbarClosingEventHandlerThis event is triggered when the inline Toolbar is closing.EditorInlineToolbarClosingEventArgs
OnDropDownToolbarOpenEventCallback<Event>This event is triggered when the Drop Down Toolbar is opened.dynamic target- The toolbar that is the target of the operation., dynamic owner- The tooltip target (the owner of the tooltip).
DropDownToolbarOpenedevent EditorDropDownToolbarOpenedEventHandlerThis event is triggered when the Drop Down Toolbar is opened.EditorDropDownToolbarOpenedEventArgs
OnDropDownToolbarOpeningEventCallback<Event>This event is triggered when the Drop Down Toolbar is opening. The opening operation can be canceled by calling event.preventDefault() in the event handler function.dynamic target- The toolbar that is the target of the operation.
DropDownToolbarOpeningevent EditorDropDownToolbarOpeningEventHandlerThis event is triggered when the Drop Down Toolbar is opening. The opening operation can be canceled by calling event.preventDefault() in the event handler function.EditorDropDownToolbarOpeningEventArgs
OnDropDownToolbarCloseEventCallback<Event>This event is triggered when the Drop Down Toolbar is closed.dynamic target- The toolbar that is the target of the operation., dynamic owner- The tooltip target (the owner of the tooltip).
DropDownToolbarClosedevent EditorDropDownToolbarClosedEventHandlerThis event is triggered when the Drop Down Toolbar is closed.EditorDropDownToolbarClosedEventArgs
OnDropDownToolbarClosingEventCallback<Event>This event is triggered when the Drop Down Toolbar is closing. The closing operation can be canceled by calling event.preventDefault() in the event handler function.dynamic target- The toolbar that is the target of the operation.
DropDownToolbarClosingevent EditorDropDownToolbarClosingEventHandlerThis event is triggered when the Drop Down Toolbar is closing. The closing operation can be canceled by calling event.preventDefault() in the event handler function.EditorDropDownToolbarClosingEventArgs
OnDialogOpenEventCallback<Event>This event is triggered the Dialog Window is opened.dynamic target- The window that is the target of the operation., dynamic item- The toolbar item is the target of the operation.
DialogOpenedevent EditorDialogOpenedEventHandlerThis event is triggered the Dialog Window is opened.EditorDialogOpenedEventArgs
OnDialogOpeningEventCallback<Event>This event is triggered before the Dialog Window is opened. The event can be prevented via event.preventDefault().dynamic target- The window that is the target of the operation., dynamic item- The toolbar item that is the target of the operation.
DialogOpeningevent EditorDialogOpeningEventHandlerThis event is triggered before the Dialog Window is opened. The event can be prevented via event.preventDefault().EditorDialogOpeningEventArgs
OnDialogCloseEventCallback<Event>This event is triggered when the Dialog Window is closed.dynamic target- The window that is the target of the operation., dynamic item- The toolbar item that is the target of the operation.
DialogClosedevent EditorDialogClosedEventHandlerThis event is triggered when the Dialog Window is closed.EditorDialogClosedEventArgs
OnDialogClosingEventCallback<Event>This event is triggered before the Dialog Window is closing. The event can be prevented via event.preventDefault().dynamic target- The window that is the target of the operation., dynamic item- The toolbar item that is the target of the operation.
DialogClosingevent EditorDialogClosingEventHandlerThis event is triggered before the Dialog Window is closing. The event can be prevented via event.preventDefault().EditorDialogClosingEventArgs
OnImageUploadSuccessEventCallback<Event>This event is triggered when the uploading of an image/video is successful.dynamic target- The file upload element that is the target of the operation., dynamic item- The toolbar item that is the target of the operation., dynamic filename- The name of the uploaded file., dynamic type- The type of the uploaded file., dynamic size- The size of the uploaded file., int index- The index of the uploaded file., dynamic status- The status of the uploaded file. Whether there was an error or success.
ImageUploadSuccessedevent EditorImageUploadSuccessedEventHandlerThis event is triggered when the uploading of an image/video is successful.EditorImageUploadSuccessedEventArgs
OnImageUploadFailedEventCallback<Event>This event is triggered when the uploading of an image/video is unsuccessful.dynamic target- The file upload element that is the target of the operation., dynamic item- The toolbar item that is the target of the operation., dynamic filename- The name of the canceled file., dynamic type- The type of the canceled file., dynamic size- The size of the canceled file., int index- The index of the canceled file., dynamic status- The status of the uploaded file. Whether there was an error or success.
ImageUploadFailedevent EditorImageUploadFailedEventHandlerThis event is triggered when the uploading of an image/video is unsuccessful.EditorImageUploadFailedEventArgs
OnToobarItemClickEventCallback<Event>This event is triggered when a Toolbar item is clicked.dynamic originalEvent- The original click event., dynamic value- The name of the toolbar item that was clicked.
ToobarItemClickedevent EditorToobarItemClickedEventHandlerThis event is triggered when a Toolbar item is clicked.EditorToobarItemClickedEventArgs
OnMessageCloseEventCallback<Event>This event is triggered when a message is closed.dynamic instance- The toast item that is the target of the operation.
MessageClosedevent EditorMessageClosedEventHandlerThis event is triggered when a message is closed.EditorMessageClosedEventArgs
OnMessageOpenEventCallback<Event>This event is triggered when a message is opened.dynamic instance- The toast item that is the target of the operation.
MessageOpenedevent EditorMessageOpenedEventHandlerThis event is triggered when a message is opened.EditorMessageOpenedEventArgs

Enums

EditorContentFilteringAttributeFilterMode

EditorContentFilteringAttributeFilterMode.BlackList
EditorContentFilteringAttributeFilterMode.WhiteList

EditorContentFilteringTagFilterMode

EditorContentFilteringTagFilterMode.BlackList
EditorContentFilteringTagFilterMode.WhiteList

EditorContentFilteringStyleAttributeFilterMode

EditorContentFilteringStyleAttributeFilterMode.BlackList
EditorContentFilteringStyleAttributeFilterMode.WhiteList

EditorContextMenu

EditorContextMenu.Default
EditorContextMenu.Browser
EditorContextMenu.None

EditMode

EditMode.Html
EditMode.Markdown

EditorImageFormat

EditorImageFormat.Base64
EditorImageFormat.Blob

PasteFormat

PasteFormat.Prompt
PasteFormat.PlainText
PasteFormat.KeepFormat
PasteFormat.CleanFormat

ToolbarMode

ToolbarMode.Menu
ToolbarMode.SingleLineRibbon

ToolbarViewMode

ToolbarViewMode.Toggle
ToolbarViewMode.MultiRow
ToolbarViewMode.Scroll

EditorContentFiltering Properties

NameTypeDefaultDescription
Attributesstring[]new string[]{}Determines which element attributes to filter.
AttributeFilterModeEditorContentFilteringAttributeFilterModeEditorContentFilteringAttributeFilterMode.BlackListDetermines whether to allow (whiteList) or remove (blackList) the specified attributes.
Tagsstring[]new string[]{}Determines which element tags to filter.
TagFilterModeEditorContentFilteringTagFilterModeEditorContentFilteringTagFilterMode.BlackListDetermines whether to allow (whiteList) or remove (blackList) the specified tags.
StyleAttributesstring[]new string[]{}Determines which style attributes to filter.
StyleAttributeFilterModeEditorContentFilteringStyleAttributeFilterModeEditorContentFilteringStyleAttributeFilterMode.BlackListDetermines whether to allow (whiteList) or remove (blackList) the specified style attributes.

EditorDataExport Properties

NameTypeDefaultDescription
StyleobjectnullSets a custom style object of the dataExport.
FileNamestring"jqxScheduler"Sets the exported file's name.
PageOrientationstring"portrait"Sets the page orientation, when exporting to PDF.

EditorIframeSettings Properties

NameTypeDefaultDescription
AttributesobjectnullDetermines the attributes and their values that will be set to the iframe. Here's how to define attributes:
attributes: { height: 500 }
EnabledboolfalseEnables/Disables the usage of an iframe for the content of the Editor.
Resourcesstring"portrait"Determines the resources like scripts/styles that will be imported into the iframe. Here's how to define resources:
resources: { 'style': { href: 'styles.css' }, 'script': { src: 'index.js', type: 'module' }} 

EditorToolbarItem Properties

NameTypeDefaultDescription
Namestring""The unique name of the toolbar item. The list of all possible names is available in the description above.
DisabledboolfalseDetermines whethet the item is disabled or not.
AdvancedboolfalseApplicable only to item 'paste'. Transforms the type of the Paste toolbar item to drop down list with paste format options.
DataSourceIEnumerable<object>new List<object>()Allows to set a different dataSource for the toolbar items of type 'drop-down' or 'color-input.
InlineToolbarItemsIEnumerable<object>new List<object>()Defines the list of toolbar items for the Inline Toolbar. Accept the same values as toolbarItems property.
EditorToolbarItemEditornew ToolbarItemEditor()Allows to set predefined values for the Dialog Window of the following toolbar items: 'table', 'image', 'video', 'hyperlink'.
TemplateobjectnullAllows to set a template for a custom Toolbar item when the name attribute is set to 'custom'.
Widthobject""Determines the width of the toolbar item.

ToolbarItemEditor Properties

NameTypeDefaultDescription
Addressstring""Allows to preset the value for the hyperlink address field in the Dialog Window.
Targetstring""Allows to preset the value for the hyperlink target field in the Dialog Window.
Textstring""Allows to preset the value for the hyperlink text field in the Dialog Window.
Titlestring""Allows to preset the value for the hyperlink/image title field in the Dialog Window.
FileobjectnullAllows to preset the value for the image/video file uploader in the Dialog Window.
Altstring""Allows to preset the value for the image/video alt field in the Dialog Window.
Urlstring""Allows to preset the value for the image/video url field in the Dialog Window.
Widthobject""Allows to preset the value for the image/table/video width field in the Dialog Window.
Heightobject""Allows to preset the value for the image/table/video height field in the Dialog Window.
Captionstring""Allows to preset the value for the image/video caption field in the Dialog Window.
Alignmentstring""Allows to preset the value for the image/video alignment field in the Dialog Window.
Displaystring""Allows to preset the value for the image/video display field in the Dialog Window.
DraggableboolfalseAllows to preset the value for the image draggable field in the Dialog Window.
ResizableboolfalseAllows to preset the value for the image/table/video resizable field in the Dialog Window.
Colsobject""Allows to preset the value for the table cols field in the Dialog Window.
Rowsobject""Allows to preset the value for the table rows field in the Dialog Window.
TableheaderboolfalseAllows to preset the value for the table header field in the Dialog Window.
AltrowsboolfalseAllows to preset the value for the table altrows field in the Dialog Window.
DashedbordersboolfalseAllows to preset the value for the table dashedborders field in the Dialog Window.