Class BlockEditor
Inheritance
Namespace: Syncfusion.EJ2.BlockEditor
Assembly: Syncfusion.EJ2.dll
Syntax
public class BlockEditor : EJTagHelper
Constructors
BlockEditor()
Declaration
public BlockEditor()
Properties
AfterPasteCleanup
Event triggered after a paste operation occurs in the block editor. This event provides details about the pasted content.
Declaration
public string AfterPasteCleanup { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
BackgroundColorSettings
Defines the color palette for the background color (text highlight color) toolbar command.
Declaration
public BackgroundColorSettings BackgroundColorSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| BackgroundColorSettings | The default value is null |
BeforeFileUpload
Event triggered before a file upload begins. This event is cancelable - set args.cancel to true to prevent the upload. Allows host applications to validate files or add custom data to the upload request.
Declaration
public string BeforeFileUpload { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
BeforePasteCleanup
Event triggered before a paste operation occurs in the block editor. This event allows interception or modification of the pasted content.
Declaration
public string BeforePasteCleanup { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
BlockActionMenuSettings
Specifies the configuration settings for the block actions menu. This property allows customization of the actions menu within the editor.
Declaration
public BlockActionMenuSettings BlockActionMenuSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| BlockActionMenuSettings | The default value is null |
BlockChanged
Event triggered when the editor blocks are changed. This event provides details about the changes made to the editor blocks.
Declaration
public string BlockChanged { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
BlockDragging
Event triggered during the dragging operation of a block. This event provides details about the drag operation.
Declaration
public string BlockDragging { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
BlockDragStart
Event triggered when the drag operation for a block starts. This event provides details about the initial stage of the drag.
Declaration
public string BlockDragStart { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
BlockDropped
Event triggered when a block is dropped after a drag operation. This event provides details about the block drop action.
Declaration
public string BlockDropped { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
Blocks
Specifies an array of block models representing the content of the editor. This property holds the various blocks that make up the editor's content.
Declaration
public object Blocks { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The default value is null |
Blur
Event triggered when the block editor loses focus. This event provides details about the blur action.
Declaration
public string Blur { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
CodeBlockSettings
Configures settings related to code block in the editor. This property utilizes the CodeBlockSettingsModel to specify various options for code block settings.
Declaration
public object CodeBlockSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The default value is null |
CommandMenuSettings
Specifies configuration options for editor commands. This property allows customization of command behaviors within the editor.
Declaration
public CommandMenuSettings CommandMenuSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| CommandMenuSettings | The default value is null |
ContentTemplate
To get or set value for ContentTemplate.
Declaration
public MvcTemplate<object> ContentTemplate { get; set; }
Property Value
| Type |
|---|
| Syncfusion.EJ2.MvcTemplate<System.Object> |
ContextMenuSettings
Specifies settings for the context menu. This property configures the context menu options that appear on right-click actions.
Declaration
public ContextMenuSettings ContextMenuSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| ContextMenuSettings | The default value is null |
Created
Event triggered after the Blockeditor is rendered completely.
Declaration
public string Created { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
CssClass
Specifies a custom CSS class to apply to the editor. This property allows for additional styling by applying a custom CSS class.
Declaration
public string CssClass { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is "" |
EnableDragAndDrop
Specifies whether drag and drop functionality is enabled for the blocks. This property enables or disables drag-and-drop operations within the block editor.
Declaration
public bool EnableDragAndDrop { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is true |
EnableHtmlEncode
Specifies whether HTML encoding is enabled. This property determines if the content will be encoded to escape special HTML characters.
Declaration
public bool EnableHtmlEncode { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is false |
EnableHtmlSanitizer
Specifies whether the HTML sanitizer is enabled. This property determines if the HTML content will be sanitized to remove potentially harmful tags and attributes.
Declaration
public bool EnableHtmlSanitizer { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is true |
EnablePersistence
Enable or disable persisting component's state between page reloads.
Declaration
public bool EnablePersistence { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is false |
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is false |
FileUploadFailed
Event triggered when a file upload fails or validation errors occur. Provides error information for display to the user.
Declaration
public string FileUploadFailed { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
FileUploading
Event triggered during file upload with progress updates. Emits progress information at regular intervals (typically 10% increments).
Declaration
public string FileUploading { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
FileUploadSuccess
Event triggered when a file upload completes successfully. Provides server response containing the uploaded image URL and metadata.
Declaration
public string FileUploadSuccess { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
Focus
Event triggered when the block editor gains focus. This event provides details about the focus action.
Declaration
public string Focus { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
FontColorSettings
Defines the color palette for the font color toolbar command.
Declaration
public FontColorSettings FontColorSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| FontColorSettings | The default value is null |
Height
Specifies the height of the editor. This property sets the height of the editor, which can be a string or number.
Declaration
public string Height { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is "auto" |
HtmlAttributes
Allows additional HTML attributes such as title, name, etc., and accepts n number of attributes in a key-value pair format.
Declaration
public object HtmlAttributes { get; set; }
Property Value
| Type |
|---|
| System.Object |
ImageBlockSettings
Configures settings related to image block in the editor. This property utilizes the ImageBlockSettingsModel to specify various options for image block settings.
Declaration
public ImageBlockSettings ImageBlockSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| ImageBlockSettings | The default value is null |
InlineToolbarSettings
Specifies settings for the formatting toolbar. This property configures the toolbar that provides text formatting options.
Declaration
public InlineToolbarSettings InlineToolbarSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| InlineToolbarSettings | The default value is null |
KeyConfig
Specifies custom keyboard shortcuts configuration. This property allows the definition of custom keyboard shortcuts for editor commands.
Declaration
public object KeyConfig { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The default value is null |
LabelSettings
Configures settings related to label popup in the editor. This property utilizes the LabelSettingsModel to specify various options and behaviors for paste operations.
Declaration
public LabelSettings LabelSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| LabelSettings | The default value is null |
Locale
Specifies the locale for localization. This property sets the language and regional settings for the editor. The default locale value is 'en-US'.
Declaration
public string Locale { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is "en-US" |
PasteCleanupSettings
Configures settings related to pasting content in the editor. This property utilizes the PasteCleanupSettingsModel to specify various options and behaviors for paste operations.
Declaration
public PasteCleanupSettings PasteCleanupSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| PasteCleanupSettings | The default value is null |
ReadOnly
Specifies whether the editor is in read-only mode. This property prevents users from editing the content when set to true.
Declaration
public bool ReadOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value is false |
SelectionChanged
Event triggered when the selection in the block editor changes. This event provides details about the new selection state.
Declaration
public string SelectionChanged { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is null |
TransformSettings
Specifies the configuration object for available block transformations in the inline toolbar. This property allows customization of the transform menu items including text, icons, and behavior configuration.
Declaration
public object TransformSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The default value is null |
UndoRedoStack
Specifies the maximum size of the undo/redo stack. This property determines how many actions are stored for undo and redo functionality. With a default value of 30, it allows users to revert up to 30 operations.
Declaration
public double UndoRedoStack { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The default value is 30 |
Users
Specifies an array of user models representing the list of users. This property holds user details such as name, ID, and other properties.
Declaration
public object Users { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The default value is null |
Width
Specifies the width of the editor. This property sets the width of the editor, which can be a string or number.
Declaration
public string Width { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The default value is "100%" |