Articles in this section
Category / Section

Integrating Mention with Iframe Editor in Rich Text Editor

1 min read

When integrating the Mention component with the Iframe Editor in a Rich Text Editor, it is essential to set the input element of the Rich Text Editor as the target for the Mention component. This can be accomplished by utilizing the created event of the Rich Text Editor.

Initialize the Rich Text Editor

Set up the RichTextEditor with the necessary toolbar settings and properties. Enable iframeSettings to use Iframe mode, and configure the created event accordingly.

<ejs-richtexteditor
    #rteObj
    id="mention_integration"
    placeholder="Type @ and tag the name"
    [iframeSettings]="iframe"
    (created)="onCreated($event)">   
</ejs-richtexteditor>

Set Up the Mention Component

Ensure that you have the Mention component properly initialized in your application.

<ejs-mention
  #mention
  [dataSource]="data"
  [fields]="fieldsData">  
</ejs-mention>

Target the Input Element

Use the created event to assign the input element of the Rich Text Editor to the Mention component’s target.

Here is a sample code snippet demonstrating how to achieve this:

onCreated() {
    this.mentionObj.target = this.rteObj.inputElement;
}

By following these steps, you can successfully integrate the Mention feature with the Iframe Editor in your Rich Text Editor.

Additional References

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied