Back to Devexpress

ContentRemovedEvent Class

aspnetcore-js-devexpress-dot-richedit-992a0b53.md

latest2.8 KB
Original Source

ContentRemovedEvent Class

An event that occurs when content is removed from the document.

Declaration

ts
export class ContentRemovedEvent extends RichEditEvent<ContentRemovedEventArgs>

Remarks

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

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

cshtml
@(Html.DevExpress().RichEdit("richEdit")
 .OnContentRemoved("function(s,e) {console.log('The removed text is: ' + e.removedText);}")
 // ...

Use the contentRemoved property to specify the event handler.

javascript
const options = DevExpress.RichEdit.createOptions();
options.events.contentRemoved = function(s,e) {
  console.log('The removed text is: ' + e.removedText);
};

The contentRemoved 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.contentRemoved.addHandler(function(s, e) {
  console.log('The removed text is: ' + e.removedText);
});

The event handler receives an argument of the ContentRemovedEventArgs 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> ContentRemovedEvent

See Also

Client-Side Events