Back to Devexpress

CalculateDocumentVariableEventArgs Class

aspnetcore-js-devexpress-dot-richedit-bd24a936.md

latest3.4 KB
Original Source

CalculateDocumentVariableEventArgs Class

Contains data for the CalculateDocumentVariable event.

Declaration

ts
export class CalculateDocumentVariableEventArgs extends EventArgs

Remarks

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.

Inheritance

EventArgs CalculateDocumentVariableEventArgs

Properties

args Property

Provide access to arguments within the DOCVARIABLE field.

Declaration

ts
args: string[]

Property Value

TypeDescription
string[]

An array containing DOCVARIABLE field arguments.

|

fieldInterval Property

Returns the text buffer interval that contains the field.

Declaration

ts
readonly fieldInterval: Interval

Property Value

TypeDescription
Interval

The text buffer interval.

|

Remarks

javascript
options.events.calculateDocumentVariable = (s, e) => {
    if(e.variableName == 'sectionIndex')
        e.value = (rich.document.sections.find(e.fieldInterval.start).index + 1).toString();
};

keepLastParagraph Property

Specifies whether the last paragraph mark of the inserted document is kept in the resulting document.

Declaration

ts
keepLastParagraph: boolean

Property Value

TypeDescription
boolean

true , to retain the last paragraph mark of the inserted document; otherwise, false.

|

Remarks

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.

value Property

Specifies the result of the DOCVARIABLE field that fired the event.

Declaration

ts
value: null | string | DocumentProcessorBase

Property Value

TypeDescription
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.

|

variableName Property

Gets the name of the document variable to which the DOCVARIABLE field refers.

Declaration

ts
variableName: string

Property Value

TypeDescription
string

The name of the document variable.

|

Remarks

The variableName property enables you to identify a document variable for which the event is fired.