DocumentEditorContainer
23 Sep 20259 minutes to read
Document Editor container component.
Properties
autoResizeOnVisibilityChange boolean
Gets or sets a value indicating whether to start automatic resize with the specified time interval and iteration count.
- Resize action triggers automatically for the specified number of iterations, or till the parent element’s height and width is non-zero.
- If the parent element’s height and width is zero even in the last iteration, then the default height and width (200) is allocated for the Document editor.
Defaults to false
backstageMenu BackStageMenuModel
Gets or sets the backstage menu configuration.
When set, this will replace the traditional file menu with a backstage view.
Note: This property is only considered when the toolbarMode property is set to Ribbon.
Defaults to undefined
beforeXmlHttpRequestSend EmitType<XmlHttpRequestEventArgs>
Triggers before a server request is started, allows you to modify the XMLHttpRequest object (setting additional headers, if needed).
currentUser string
Gets or sets the current user.
Defaults to ’’
documentEditorSettings DocumentEditorSettingsModel
Defines the settings for DocumentEditor customization.
Defaults to {}
documentSettings DocumentSettingsModel
Gets the settings and properties of the document that is opened in Document editor component.
Defaults to {}
enableAutoFocus boolean
Gets or sets a value indicating whether the automatic focus behavior is enabled for Document editor or not.
By default, the Document editor gets focused automatically when the page loads. If you want the Document editor not to be focused automatically, then set this property to false.
Defaults to true
enableComment boolean
Gets or sets a value indicating whether comment is enabled or not
Defaults to true
enableCsp boolean
Enables the rendering with strict Content Security policy.
enableLocalPaste boolean
Enables the local paste.
Defaults to false
enableLockAndEdit boolean
Enables the partial lock and edit module.
Defaults to false
enablePersistence boolean
Enable or disable persisting component’s state between page reloads.
Defaults to false
enableRtl boolean
Enable or disable rendering component in right to left direction.
Defaults to false
enableSpellCheck boolean
Enable or disable the spell checker in document editor container.
Defaults to false
enableToolbar boolean
Enable or disable either Toolbar or Ribbon based on the toolbarMode property.
Defaults to true
enableTrackChanges boolean
Enable or disable the track changes in document editor container.
Defaults to false
fileMenuItems []
Defines file menu items for Ribbon.
Note: This property is only considered when the toolbarMode property is set to Ribbon.
Defaults to [‘New’, ‘Open’, ‘Export’,’Print’]
headers object[]
Adds the custom headers to XMLHttpRequest.
Defaults to []
height string
Defines the height of the DocumentEditorContainer component
Defaults to ‘320px’
layoutType LayoutType
Gets or sets the Layout Type.
Defaults to Pages
locale string
Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.
Defaults to ’’
restrictEditing boolean
Specifies the restrict editing operation.
Defaults to false
ribbonLayout RibbonLayoutType
Specifies the current ribbon layout type, either ‘Classic’ or ‘Simplified’.
Note: This property is only considered when the toolbarMode property is set to Ribbon.
Defaults to ‘Simplified’
serverActionSettings ContainerServerActionSettingsModel
Defines the settings of the DocumentEditorContainer service.
serviceUrl string
Gets or sets the Sfdt service URL.
Defaults to ’’
showPropertiesPane boolean
Show or hide properties pane.
Defaults to true
toolbarItems []
Defines toolbar items for DocumentEditorContainer.
Defaults to [‘New’,’Open’,’Separator’,’Undo’,’Redo’,’Separator’,’Image’,’Table’,’Hyperlink’,’Bookmark’,’TableOfContents’,’Separator’,’Header’,’Footer’,’PageSetup’,’PageNumber’,’Break’,’InsertFootnote’,’InsertEndnote’,’Separator’,’Find’,’Separator’,’Comments’,’TrackChanges’,’LocalClipboard’,’RestrictEditing’,’Separator’,’FormFields’,’UpdateFields’,’ContentControl’,’XML Mapping’]
toolbarMode ToolbarMode
Specifies the toolbar mode for the document editor container. Two modes are available: ‘Toolbar’ and ‘Ribbon’.
Defaults to ‘Toolbar’
userColor string
Gets or sets the color used for highlighting the editable ranges or regions of the currentUser in Document Editor. The default value is “#FFFF00”.
If the visibility of text affected due this highlight color matching with random color applied for the track changes, then modify the color value of this property to resolve text visibility problem.
Defaults to ‘#FFFF00’
width string
Defines the width of the DocumentEditorContainer component
Defaults to ‘100%’
zIndex number
Specifies the z-order for rendering that determines whether the dialog is displayed in front or behind of another component.
Defaults to 2000
documentEditor DocumentEditor
Gets the DocumentEditor instance.
ribbon Ribbon
Gets the ribbon instance.
toolbar Toolbar
Gets the toolbar instance.
Methods
addEventListener
Adds the handler to the given event listener.
| Parameter | Type | Description |
|---|---|---|
| eventName | string |
A String that specifies the name of the event |
| handler | Function |
Specifies the call to run when the event occurs. |
Returns void
appendTo
Appends the control within the given HTML element
| Parameter | Type | Description |
|---|---|---|
| selector (optional) |
string | HTMLElement
|
Target element where control needs to be appended |
Returns void
attachUnloadEvent
Adding unload event to persist data when enable persistence true
Returns void
dataBind
When invoked, applies the pending property changes immediately to the component.
Returns void
destroy
Destroys all managed resources used by this object.
Returns void
detachUnloadEvent
Removing unload event to persist data when enable persistence true
Returns void
getLocalData
Returns the persistence data for component
Returns any
getRootElement
Returns the route element of the component
Returns HTMLElement
handleUnload
Handling unload event to persist data when enable persistence true
Returns void
refresh
Applies all the pending property changes and render the component again.
Returns void
removeEventListener
Removes the handler from the given event listener.
| Parameter | Type | Description |
|---|---|---|
| eventName | string |
A String that specifies the name of the event to remove |
| handler | Function |
Specifies the function to remove |
Returns void
resize
Resizes the container component and its sub elements based on given size or client size.
| Parameter | Type | Description |
|---|---|---|
| width (optional) | number |
The width to be applied. |
| height (optional) | number |
The height to be applied. |
Returns void
setDefaultCharacterFormat
Set the default character format for document editor container
| Parameter | Type | Description |
|---|---|---|
| characterFormat | CharacterFormatProperties |
Specify the character format properties to be applied for document editor. |
Returns void
setDefaultParagraphFormat
Set the default paragraph format for document editor container
| Parameter | Type | Description |
|---|---|---|
| paragraphFormat | ParagraphFormatProperties |
Specify the paragraph format properties to be applied for document editor. |
Returns void
setDefaultSectionFormat
Set the default section format for document editor container
| Parameter | Type | Description |
|---|---|---|
| sectionFormat | SectionFormatProperties |
Specify the section format properties to be applied for document editor. |
Returns void
Inject
Dynamically injects the required modules to the component.
| Parameter | Type | Description |
|---|---|---|
| moduleList | Function[] |
? |
Returns void
Events
beforeAcceptRejectChanges EmitType<RevisionActionEventArgs>
Triggers before accepting or rejecting changes.
beforeCommentAction EmitType<CommentActionEventArgs>
Triggers on comment actions(Post, edit, reply, resolve, reopen).
beforePaneSwitch EmitType<BeforePaneSwitchEventArgs>
Trigger before switching panes in DocumentEditor.
beforePaste EmitType<BeforePasteEventArgs>
This event is triggered before content is pasted in Document Editor.
commentDelete EmitType<CommentDeleteEventArgs>
Triggers on deleting a comment.
contentChange EmitType<ContainerContentChangeEventArgs>
Triggers whenever the content changes in the document editor container.
contentControl EmitType<Object>
Triggers when user interaction prevented in content control.
created EmitType<Object>
Triggers when the component is created
customContextMenuBeforeOpen EmitType<BeforeOpenCloseCustomContentMenuEventArgs>
Triggers before opening the custom context-menu option.
customContextMenuSelect EmitType<CustomContentMenuEventArgs>
Triggers while selecting the custom context-menu option.
destroyed EmitType<Object>
Triggers when the component is destroyed.
documentChange EmitType<ContainerDocumentChangeEventArgs>
Triggers whenever document changes in the document editor container.
fileMenuItemClick EmitType<ClickEventArgs>
Triggers when toolbar item is clicked.
Note: This event is only considered when the toolbarMode property is set to Ribbon.
selectionChange EmitType<ContainerSelectionChangeEventArgs>
Triggers whenever selection changes in the document editor container.
serviceFailure EmitType<ServiceFailureArgs>
Triggers when the server action fails.
toolbarClick EmitType<ClickEventArgs>
Triggers when toolbar item is clicked.
trackChange EmitType<TrackChangeEventArgs>
Triggers Keyboard shortcut of TrackChanges.