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
close icon

Search and replace in Rich Text Editor

Hi all,
The content of my RTE is as below:
«Select:Referring MD»   «EndSelect»


I have two questions:
1. Can I search/replace text in Rich Text Editor ? For example, I want to search [date] and replace by current day. 
2. Can I select each character in content from the beginning to the end. For example
Step 1: select "["
Step 2: select "d"
Step 3: select "a"
Step 4: select "t"
....
Is there anyone who can help me ?
Thanks and best regards,

3 Replies

KS Kaliswaran Shanmuga Sundaram Syncfusion Team January 27, 2015 01:34 PM UTC

Hi Duyvt,

Thanks for using Syncfusion products.

Query: “Can I search/replace text in Rich Text Editor ? For example, I want to search [date] and replace by current day. Can I select each character in content from the beginning to the end”.

Currently in our RTE there is no built-in option is available to achieve your requirement. But we can achieve it in the sample level.

We can achieve your requirement by using a API called “customTools” present inside the “tools ” API. It is used to define our custom action. In that we need to define the button component for find and replace option. In the click event of button component we need handle the find and replace function.

Please refer following JS customTools sample for more detailed information.

http://js.syncfusion.com/demos/web/#!/azure/rte/customtool

If you need of a sample for this function, please let us know. We are ready to provide the custom sample at earliest.

Please let us know if you have further queries.

Regards,

Kaliswaran S


DU duyvt January 28, 2015 02:07 AM UTC

Thanks for quick reply,

I can add "Find/Replace" button into toolbar. But I don't know the way to handle the find and replace function. Could you please give me an example.

Thanks,  


KS Kaliswaran Shanmuga Sundaram Syncfusion Team January 28, 2015 02:05 PM UTC

Hi Duyvt,

Thanks for your update.

Query : I can add "Find/Replace" button into toolbar. But I don't know the way to handle the find and replace function. Could you please give me an example.

We have prepared the sample based on your requirement. You can also download the attached sample from the following location.

Sample Location : RTE-Sample

In the above sample, we have used our Rich Text Editor “customTool” API to handle the find and replace action. By using “customTool” API we have created a button like “Find”. In the button click event we have called the find and replace function.

Please let me know if you have further queries in the provided sample or any other further enhancement in the sample.

Regards,

Kaliswaran S

Loader.
Live Chat Icon For mobile
Up arrow icon