Back to Devexpress

Hyperlink Class

aspnetcore-js-devexpress-dot-richedit-1898863d.md

latest2.6 KB
Original Source

Hyperlink Class

Defines a hyperlink in the document.

Declaration

ts
export class Hyperlink extends Field

Remarks

javascript
var text = "Visit our site";
var url = "https://www.devexpress.com/";
var tooltip = "DevExpress site";

richEdit.beginUpdate();
richEdit.history.beginTransaction();
var subDocument = richEdit.selection.activeSubDocument;

var position = richEdit.selection.active;
position = subDocument.insertParagraph(position).interval.end;
position = subDocument.hyperlinks.create(position, new DevExpress.RichEdit.HyperlinkInfo(text, url, "", tooltip)).interval.end;
subDocument.insertParagraph(position);

richEdit.endUpdate();
richEdit.history.endTransaction();

Inherited Members

codeInterval

index

interval

isHyperlink

isShowCode

name

resultInterval

subDocument

delete

update

Inheritance

Field Hyperlink

Properties

hyperlinkInfo Property

Provide access to information about a hyperlink.

Declaration

ts
get hyperlinkInfo(): HyperlinkInfo
set hyperlinkInfo(hyperlinkInfo: HyperlinkInfo)

Property Value

TypeDescription
HyperlinkInfo

An object that contain information about a hyperlink.

|

Remarks

javascript
// Gets URLs of all hyperlinks in the main sub-document
var hyperlinks = richEdit.document.hyperlinks;
var hyperlinkUrls = [];
for(var i = 0, hyperlink; hyperlink = hyperlinks.getByIndex(i); i++)
    if (hyperlink.hyperlinkInfo.url)
        hyperlinkUrls.push(hyperlink.hyperlinkInfo.url);

See Also

Common Use Cases: Hyperlink