aspnetcore-js-devexpress-dot-richedit-c3474253.md
A bookmark in the document.
export class Bookmark
The example below demonstrates how to create a bookmark:
var textInterval = richEdit.document.insertText(0, 'text');
var bookmark = richEdit.document.bookmarks.create(textInterval, 'bookmarkName');
Refer to the following topic for more examples: Bookmark.
Bookmark BookmarkBase
Gets the bookmark’s index in a bookmark collection.
get index(): number
| Type | Description |
|---|---|
| number |
A zero-based index.
|
Gets the text buffer interval that contains the bookmark.
get interval(): Interval
| Type | Description |
|---|---|
| Interval |
The text buffer interval.
|
// returns a text of the specified bookmark
var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark) {
var text = bookmark.subDocument.getText(bookmark.interval);
}
Returns a name of the bookmark.
get name(): string
| Type | Description |
|---|---|
| string |
The bookmark name.
|
A bookmark name should start with a letter and must be unique in the collection of bookmarks in the current document.
var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark) {
var bookmarkInterval = bookmark.interval;
}
Gets a sub-document where the bookmark is placed.
get subDocument(): SubDocument
| Type | Description |
|---|---|
| SubDocument |
The sub-document that contains the bookmark.
|
// returns a text of the specified bookmark
var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark) {
var text = bookmark.subDocument.getText(bookmark.interval);
}
Deletes the bookmark.
delete(): void
var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark)
bookmark.delete();