This is a migrated thread and some comments may be shown as answers.

Compare Radeditor content/Track changes

4 Answers 223 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 19 Jul 2010, 02:20 PM
hello,

I have used Telerik RadEditor in my site and I load content dynamically and then I store RadEditor.Content in a string variable and then if I dont make changes even, I get when comparing two strings the difference not identical. I have then watched both strings the thing is the white space <br> tag is rendered differently, the sequence in attributes of HTML tags has been changed in both string (Editor's Content).

Is there any thing I can load the content and save it and then if any changes occurs I track that as well and do the things?

It would be great even if I can programmatically call changes tracking button and proceed further

Thanks,
Sunny

4 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 22 Jul 2010, 04:17 PM
Hi Sunny,

RadEditor offers a Track Changes dialog which can be used by the user to see the changes that was made to the content during the current edit session. You can find more detailed information regarding this dialog in the following live demo:
Editor / Dialogs

RadEditor's content area is an editable <iframe> and RadEditor is based on the standard browser's RichTextEditing engine. When content is entered in RadEditor the actual HTML code in the content area differs depending on the used browser and this behavior cannot be modified during run time. RadEditor has a number of built-in content filters which modify the content in order to provide correct output - XHTML compliant code, same content generated under different browsers, etc.

When content is loaded in the content area it is handled by the browser's RichTextEditing engine and is displayed in the editable <iframe>. When user switch between RadEditor's Edit Modes (Design, HTML, Preview) or submit the form the enabled content filters are fired to modify the content.

For your convenience I have attached a simple page with a standard editable <iframe> to examine the default browser's behavior.

Regards,
Dobromir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sunny
Top achievements
Rank 1
answered on 23 Jul 2010, 09:29 AM
hi Dobromir,

I need to compare the current Radeditor's content with my saved content in variable. The problem is when I compare both, even I don't change the value, it doesnt compare. In other words, I need to check whether this Editor's content has been changed or not on a button click programmatically NOT Manually.

Please help me out. I need to have it urgently..please
Thanks,
Sunny Dave
0
Accepted
Dobromir
Telerik team
answered on 27 Jul 2010, 02:43 PM
Hi Sunny,

By default, RadEditor is adding \r\n line-feeds to the content in order to provide more readable content in HTMLView and Database. If this is the difference in the content of the RadEditor.Content and the initial content you can use the approach provided in this KB article how to remove these additional line-feeds.

In addition, if the initial content is not generated by RadEditor, as I mentioned in my previous reply, the editor modifies the content using content filters which are entirely JavaScript based. If this is the case, the content can be compared only on the client-side. Please find attached a sample project that compares the initially loaded content with the content before submit.


Best wishes,
Dobromir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sunny
Top achievements
Rank 1
answered on 28 Jul 2010, 11:37 AM
hi Dobromir ,

This is what I was trying but couldn't!!

Now it is working fine!!

Thanks a ton

Sunny Dave
Tags
Editor
Asked by
Sunny
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Sunny
Top achievements
Rank 1
Share this question
or