We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Ability to configure multiple handle (ie: @ etc) characters for Mentions

Hi, would it be possible to add a little bit more functionality to the RTE Mentions so we can have multiple characters instead of just @? So, for example, I could use @ for users (would hit the users DB) but,  for example, I could also configure # to hit some other DB and display some different data. This would be super useful. Thanks in advance!


1 Reply 1 reply marked as answer

VJ Vinitha Jeyakumar Syncfusion Team January 4, 2023 07:28 AM UTC

Hi Ricardo,

Your requirement to use different mentioned characters that are used to render the different suggestion list can be achieved by using MentionChar property of SfMention control. Please check the code and sample below,

Code snippet:
<div class="control-section">
    <SfRichTextEditor ID="mentionIntegration">
    </SfRichTextEditor>
</div>
     <div id="mention_integration">
        <SfMention MentionChar="@ProjMentionChar" TItem="UserData" Target="#mentionIntegration .e-rte-content .e-content" DataSource="@data" PopupHeight="200px" PopupWidth="250px">
           
            <ChildContent>
            <MentionFieldSettings Text="Name" Value="EmailId"></MentionFieldSettings>
            </ChildContent>
        </SfMention>

        <SfMention MentionChar="@CostMentionChar" TItem="MentionData" Target="#mentionIntegration .e-rte-content .e-content" DataSource="@UseCostData">
            <ChildContent>
                <MentionFieldSettings Text="Value"></MentionFieldSettings>
            </ChildContent>
        </SfMention>
    </div>
@code {
    private char ProjMentionChar { get; set; } = '#';
     private char CostMentionChar { get; set; } = '$';
}




Regards,
Vinitha

Marked as answer
Loader.
Live Chat Icon For mobile
Up arrow icon