BookmarkCollection<TBookmark> Class
A collection of Bookmark objects.
Declaration
export class BookmarkCollection<TBookmark extends Bookmark> extends Collection<TBookmark>
Type Parameters
Name | Type | Description |
---|---|---|
TBookmark | Bookmark | The type of bookmarks. |
Remarks
var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark) {
var bookmarkInterval = bookmark.interval;
}
Inheritance
Collection<T>
BookmarkCollection<TBookmark>
Methods
create(interval, name) Method
Creates a bookmark with the specified interval and name.
Declaration
create(
interval: IInterval,
name: string
): Bookmark
Parameters
Name | Type | Description |
---|---|---|
interval | IInterval | An object that contains information about a text interval. |
name | string | The bookmark name. |
Returns
Type | Description |
---|---|
Bookmark | The created bookmark. |
Remarks
var textInterval = richEdit.document.insertText(0, 'text');
var bookmark = richEdit.document.bookmarks.create(textInterval, 'bookmarkName');
find(position) Method
Returns a list of bookmarks that meet the specified conditions.
Declaration
find(
position: number | IInterval | IInterval[] | string | RegExp
): TBookmark[]
Parameters
Name | Type | Description |
---|---|---|
position | string | number | RegExp | IInterval | IInterval[] | A document position, interval, list of intervals, name, or regular expression. |
Returns
Type | Description |
---|---|
TBookmark[] | A list of bookmarks. |
Remarks
var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark) {
var bookmarkInterval = bookmark.interval;
}
richEdit.document.bookmarks.find(new DevExpress.RichEdit.Interval(48, 653)).forEach(
function(bookmark) {
console.log(bookmark.name);
}
);
See Also