Hyperlink Class
Defines a hyperlink in the document.
Declaration
export class Hyperlink extends Field
Remarks
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
Inheritance
Field
Hyperlink
Properties
hyperlinkInfo Property
Provide access to information about a hyperlink.
Declaration
get hyperlinkInfo(): HyperlinkInfo
set hyperlinkInfo(hyperlinkInfo: HyperlinkInfo)
Property Value
Type | Description |
---|---|
HyperlinkInfo | An object that contain information about a hyperlink. |
Remarks
// 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