aspnetcore-js-devexpress-dot-richedit-df236be2.md
Contains properties related to the mail merge functionality.
export class MailMergeOptions
Specifies the active record’s index.
get activeRecordIndex(): number
set activeRecordIndex(value: number)
| Type | Description |
|---|---|
| number |
The active record index.
|
Use the activeRecordIndex method to navigate through records when the viewMergedData property is set to true.
richEdit.mailMergeOptions.activeRecordIndex = 15;
Specifies whether the merged data is displayed in the Rich Text Editor.
get viewMergedData(): boolean
set viewMergedData(value: boolean)
| Type | Description |
|---|---|
| boolean |
true to display the merged data; false to hide the merged data.
|
richEdit.mailMergeOptions.viewMergedData = true;
Returns a data source object to which the mail merge functionality is bound.
getDataSource(): any
| Type | Description |
|---|---|
| any |
A data source object.
|
richEdit.mailMergeOptions.getDataSource();
Specifies the data source for the mail merge.
setDataSource(
dataSource: any,
callback?: (success: boolean) => void
): void
| Name | Type | Description |
|---|---|---|
| dataSource | any |
The data source object.
| | callback | (success: boolean) => void |
A function that is called after the data source is initialized.
|
The setDataSource method can accept the DataSource object as the dataSource parameter.
var newDataSource = [
{ firstName: "Alex", birthYear: 1991 },
{ firstName: "Joe", birthYear: 1990 },
{ firstName: "Bob", birthYear: 1995 }
];
richEdit.mailMergeOptions.setDataSource(newDataSource);
var newDataSource = [
{ firstName: "Alex", birthYear: 1991 },
{ firstName: "Joe", birthYear: 1990 },
{ firstName: "Bob", birthYear: 1995 }
];
richEdit.mailMergeOptions.setDataSource(new DevExpress.data.DataSource({
store: {
type:'array', data: newDataSource
},
filter: ['birthYear', '>', 1990],
map: function (dataItem) {
return {
description: dataItem.firstName + ' was born in ' + dataItem.birthYear,
firstName: dataItem.firstName
}
}
}));
Send null as a parameter to remove the data source from the control and disable the mail merge functionality.
richEdit.mailMergeOptions.setDataSource(null);