aspnetcore-js-devexpress-dot-richedit-4c2af023.md
Declares Rich Text Editor options.
export interface Options
Provides access to authentication settings.
authentication?: IAuthenticationSettings
| Type | Description |
|---|---|
| IAuthenticationSettings |
An interface that declares authentication settings.
|
Provides access to autocorrect settings.
autoCorrect?: IAutocorrectSettings
| Type | Description |
|---|---|
| IAutocorrectSettings |
An interface that declares autocorrect settings.
|
Provides access to bookmark settings.
bookmarks?: IBookmarkSettings
| Type | Description |
|---|---|
| IBookmarkSettings |
An interface that declares bookmark settings.
|
Allows you to customize settings of a confirmation message that is displayed when unsaved data changes may be lost.
confirmOnLosingChanges?: IConfirmOnLosingChangesSettings
| Type | Description |
|---|---|
| IConfirmOnLosingChangesSettings |
An interface that declares confirmation message settings.
|
options.confirmOnLosingChanges.enabled = true;
options.confirmOnLosingChanges.message = "Are you sure you want to close the document?";
Provides access to context menu settings.
contextMenu?: IContextMenu
| Type | Description |
|---|---|
| IContextMenu |
An object that implements the IContextMenu interface and contains the context menu settings.
|
const options = DevExpress.RichEdit.createOptions();
var contextMenu = options.contextMenu;
// remove default items
contextMenu.removeItem(DevExpress.RichEdit.ContextMenuCommandId.DecreaseParagraphIndent);
contextMenu.removeItem(DevExpress.RichEdit.ContextMenuCommandId.IncreaseParagraphIndent);
// add an item that executes a default command
contextMenu.insertItem(new DevExpress.RichEdit.ContextMenuItem(
DevExpress.RichEdit.MailMergeTabCommandId.CreateDateField, {
icon: 'clock', text: 'Insert Date Field'
}), 1);
// add a custom item
contextMenu.insertItem(new DevExpress.RichEdit.ContextMenuItem('googleSearch', {
icon: 'search', beginGroup: true, text: 'Google Search...'
}), 1);
See Also
Specifies a document that is initially loaded in the control.
document?: {
content?: File | Blob | ArrayBuffer | string;
name?: string;
format?: DocumentFormat;
onLoaded?: (importSuccess: boolean) => void;
}
| Name | Type | Description |
|---|---|---|
| content | string | File |
The document content.
| | format | DocumentFormat |
The document format.
| | name | string |
The document name.
| | onLoaded | (importSuccess: boolean) => void |
A function that is called after the control attempted to load the document. The importSuccess parameter specifies whether the document is successfully loaded.
|
var documentAsBase64 = "e1xydGYxXGRlZmYwe1xmb250dGJse1xmMCBDYWxpYnJpO319e1xjb2xvcnRibCA7XHJlZDB"
+ "cZ3JlZW4wXGJsdWUyNTUgO1xyZWQyNTVcZ3JlZW4yNTVcYmx1ZTI1NSA7fXtcKlxkZWZjaHAgXGZzMjJ9e1xzdHl"
+ "sZXNoZWV0IHtccWxcZnMyMiBOb3JtYWw7fXtcKlxjczFcZnMyMiBEZWZhdWx0IFBhcmFncmFwaCBGb250O317XCp"
+ "cY3MyXGZzMjJcY2YxIEh5cGVybGluazt9e1wqXHRzM1x0c3Jvd2RcZnMyMlxxbFx0c3ZlcnRhbHRcdHNjZWxsY2J"
+ "wYXQyXHRzY2VsbHBjdDBcY2x0eGxydGIgTm9ybWFsIFRhYmxlO319e1wqXGxpc3RvdmVycmlkZXRhYmxlfXtcaW5"
+ "mb31cbm91aWNvbXBhdFxzcGx5dHduaW5lXGh0bWF1dHNwXGV4cHNocnRuXHNwbHRwZ3BhclxkZWZ0YWI3MjBcc2V"
+ "jdGRcbWFyZ2xzeG4xNDQwXG1hcmdyc3huMTQ0MFxtYXJndHN4bjE0NDBcbWFyZ2JzeG4xNDQwXGhlYWRlcnk3MjB"
+ "cZm9vdGVyeTcyMFxwZ3dzeG4xMjI0MFxwZ2hzeG4xNTg0MFxjb2xzMVxjb2xzeDcyMFxwYXJkXHBsYWluXHFse1x"
+ "mczIyXGNmMFxjczEgRG9jdW1lbnQgdGV4dH1cZnMyMlxjZjBccGFyfQ==";
options.document = {
content: documentAsBase64,
format: DevExpress.RichEdit.DocumentFormat.Rtf,
onLoaded: function(success) {
console.log('Initial document is loaded: ' + success);
},
};
If the document property is not specified, the control creates and loads a new document.
After the onLoaded function is processed, the documentLoaded event is fired.
Provides access to a list of client-side events specific to the RichEdit control.
events: EventHandlers
| Type | Description |
|---|---|
| EventHandlers |
An object that allows you to assign handlers to the client-side events.
|
Specifies the path where the exported document is sent for saving.
exportUrl?: string
| Type | Description |
|---|---|
| string |
The URL.
|
When a user clicks the Save button or the saveDocument method is called, the Rich Text Editor converts the document’s content to base64 and invokes the Saving event. If the event is not handled, specify the exportUrl property to save the document on the server side.
You can write the Saved event handler to perform custom actions after a server sends a response to a save request.
The ExportUrl property is not in effect if the document saving is implemented on the client side (the handled property is set to true ).
Note
When RichText Editor sends a document to the server, the control encodes the document content in UTF-8. To get the file content in string format, use a converter.
byte[] fileContents = System.Convert.FromBase64String(base64);
string rtfText = Encoding.UTF8.GetString(fileContents);
See Also
Provides access to field settings.
fields?: IFieldsSettings
| Type | Description |
|---|---|
| IFieldsSettings |
An interface that declares field settings.
|
Provides access to font settings.
fonts?: IRichEditFontsSettings
| Type | Description |
|---|---|
| IRichEditFontsSettings |
An interface that declares font settings.
|
Specifies the RichEdit height.
height?: string
| Type | Description |
|---|---|
| string |
The height.
|
Provides access to mail merge settings.
mailMerge?: IMailMergeSettings
| Type | Description |
|---|---|
| IMailMergeSettings |
An interface that declares mail merge settings.
|
Specifies the nonce value.
nonce?: string
| Type | Description |
|---|---|
| string |
A String that specifies the nonce value.
|
Provides access to PDF export settings.
pdf?: IRichEditPdfSettings
| Type | Description |
|---|---|
| IRichEditPdfSettings |
An interface that declares PDF export settings.
|
Provides access to printing settings.
printing?: IPrintingSettings
| Type | Description |
|---|---|
| IPrintingSettings |
An interface that declares printing settings.
|
Provides access to range permission settings.
rangePermissions?: IRangePermissionsSettings
| Type | Description |
|---|---|
| IRangePermissionsSettings |
An interface that declares range permission settings.
|
Specifies whether document modifications are prohibited.
readOnly?: boolean
| Type | Description |
|---|---|
| boolean |
true if the document is in a read-only state; otherwise, false.
|
options.readOnly = true;
Provides access to ribbon settings.
ribbon: Ribbon
| Type | Description |
|---|---|
| Ribbon |
An object that contains ribbon settings.
|
See Also
Provides access to search settings.
search?: IRichEditSearchSettings
| Type | Description |
|---|---|
| IRichEditSearchSettings |
Search settings.
|
The search panel and the Find and Replace dialog allow users to locate and modify text in a document opened in the Rich Text Editor. You can filter search results to prevent users from modifying certain document intervals. The example below demonstrates how to exclude intervals that contain fields from search results:
const options = DevExpress.RichEdit.createOptions();
options.search.filterInterval = (subDocument, interval) =>
subDocument.fields.find(interval).length == 0;
// ...
Provides access to spell checking settings.
spellCheck?: ISpellCheck
| Type | Description |
|---|---|
| ISpellCheck |
An interface that declares spell checking settings.
|
Specify unit for dimensions in Rich Text Editor dialogs.
unit?: RichEditUnit
| Type | Description |
|---|---|
| RichEditUnit |
The unit.
|
options.unit = DevExpress.RichEdit.RichEditUnit.Centimeter;
Provides access to view settings.
view?: IViewSettings
| Type | Description |
|---|---|
| IViewSettings |
An interface that declares view settings.
|
Specifies the RichEdit width.
width?: string
| Type | Description |
|---|---|
| string |
The width.
|