Back to Devexpress

DocumentFormattedEvent Class

aspnetcore-js-devexpress-dot-richedit-0b00b7b4.md

latest2.9 KB
Original Source

DocumentFormattedEvent Class

An event that occurs when a document layout is formatted.

Declaration

ts
export class DocumentFormattedEvent extends RichEditEvent<DocumentFormattedEventArgs>

Remarks

You can define the DocumentFormatted event handler either at the server side, at the client side, or at runtime.

Use the OnDocumentFormatted(String) method to specify the event handler.

cshtml
@(Html.DevExpress().RichEdit("richEdit")
 .OnDocumentFormatted("function(s,e) {
   console.log('The document contains ' + e.pageCount + ' page(s).');
 }")
 // ...

Use the documentFormatted property to specify the event handler.

javascript
const options = DevExpress.RichEdit.createOptions();
options.events.documentFormatted = function(s,e) {
  console.log('The document contains ' + e.pageCount + ' page(s).');
};

The documentFormatted property provides access to the addHandler(handler), removeHandler(handler), and clearHandlers methods that allow you to dynamically add and remove event handlers.

javascript
richEdit.events.documentFormatted.addHandler(function(s, e) {
  console.log('The document contains ' + e.pageCount + ' page(s).');
});

The event handler receives an argument of the DocumentFormattedEventArgs type. The argument’s properties provide information specific to this event.

Inherited Members

addHandler(handler)

clearHandlers

isEmpty

removeHandler(handler)

Inheritance

Event<TSource, TEventArgs> RichEditEvent<TEventArgs> DocumentFormattedEvent

See Also

Client-Side Events