aspnetcore-js-devexpress-dot-richedit-bd24a936.md
Contains data for the CalculateDocumentVariable event.
export class CalculateDocumentVariableEventArgs extends EventArgs
The CalculateDocumentVariable event occurs when a DOCVARIABLE field is updated. The event handler receives an argument of the CalculateDocumentVariableEventArgs type. The argument’s properties provide information specific to this event.
EventArgs CalculateDocumentVariableEventArgs
Provide access to arguments within the DOCVARIABLE field.
args: string[]
| Type | Description |
|---|---|
| string[] |
An array containing DOCVARIABLE field arguments.
|
Returns the text buffer interval that contains the field.
readonly fieldInterval: Interval
| Type | Description |
|---|---|
| Interval |
The text buffer interval.
|
options.events.calculateDocumentVariable = (s, e) => {
if(e.variableName == 'sectionIndex')
e.value = (rich.document.sections.find(e.fieldInterval.start).index + 1).toString();
};
Specifies whether the last paragraph mark of the inserted document is kept in the resulting document.
keepLastParagraph: boolean
| Type | Description |
|---|---|
| boolean |
true , to retain the last paragraph mark of the inserted document; otherwise, false.
|
The keepLastParagraph property is in effect when the value property is set to an instance of the DocumentProcessorBase class.
Set the keepLastParagraph property to true to add the last paragraph mark of the inserted document to the resulting document.
Specifies the result of the DOCVARIABLE field that fired the event.
value: null | string | DocumentProcessorBase
| Type | Description |
|---|---|
| string |
A string that is the field result. null if the field has no result.
| | DocumentProcessorBase |
An object that allows you to insert complex content as a field result.
|
Gets the name of the document variable to which the DOCVARIABLE field refers.
variableName: string
| Type | Description |
|---|---|
| string |
The name of the document variable.
|
The variableName property enables you to identify a document variable for which the event is fired.