Back to Devexpress

HyperlinkClickEvent Class

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

latest2.9 KB
Original Source

HyperlinkClickEvent Class

An event that occurs when a hyperlink is clicked.

Declaration

ts
export class HyperlinkClickEvent extends RichEditEvent<HyperlinkClickEventArgs>

Remarks

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

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

cshtml
@(Html.DevExpress().RichEdit("richEdit")
 .OnHyperlinkClick("function(s,e) {
   console.log('Navigates to ' + e.hyperlink.hyperlinkInfo.url);
 }")
 // ...

Use the hyperlinkClick property to specify the event handler.

javascript
const options = DevExpress.RichEdit.createOptions();
options.events.hyperlinkClick = function(s,e) {
  console.log('Navigates to ' + e.hyperlink.hyperlinkInfo.url);
};

The hyperlinkClick 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.hyperlinkClick.addHandler(function(s, e) {
  console.log('Navigates to ' + e.hyperlink.hyperlinkInfo.url);
});

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

See Also

Client-Side Events

How to: Implement check boxes in a document