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

Using RadEditor to Compare two Text-Strings

4 Answers 686 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 26 Jun 2009, 10:59 AM
Hi *!

I'm evaluating the ASP.net controls. I'm very impressed and happy with this sonftware-bundle. 1+

But here is my little problem:
We're looking for a solution to compare to text-strings (old-version, new-version) like the RADEditor does in "Track changes"-Dialog. Using two Editors on one page and setting the initial Content via javaScript, solve this task. But the user has to click on the "track changes" button to see the difference in the ajax-popup. The goal is to create a page looking a bit like WinDiff.

My question:
Is it possible to show the changes e.g. in a panel instead in the dialog? Is ther a way to get the results of the dialog directly, to create a page looking a bit like a win-diff split-screen?

THX and best regards from essen, germany
Alex

4 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 01 Jul 2009, 03:29 PM
Hello Alex,

There are a couple of options for you to try out.

#1
Firstly, the track changes functionality is exposed through a public class - so you can in fact try to hook your UI code to it. What you need is to instantiate the Telerik.Web.UI.Editor.Diff.DiffEngine class, e.g:

DiffEngine diff = new DiffEngine();
string result = diff.GetDiffs(curContent, initContent);


#2
The second option you could try is use the editor's client sidde fire method to start the dialog programmatically, e.g. editor.fire("TrackChangesDialog"); Furthermore, for greater ease to the user, you could in fact hide the editor itself (as the user perhaps will not need to see it) by wrapping it in a <div style="display:none"> element. Then you can open the dialog automatically - if you hook your fire code to the OnClientLoad editor event.

I hope this helps.
Sincerely yours,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
federico mondini
Top achievements
Rank 2
answered on 24 Jul 2009, 08:46 AM
Hi,

I've used the DiffEngine to load the "track changes" version of the text into the RadEditor and everything goes well.
The only thing is that the text in the Editor is not formatted on screen. I explain.

This is the html that I receive on Page load:

<h4>This is a <span class="diff_deleted">headereeeeeee</span> <span class="diff_new">header</span></h4
<>This is a normal text.</p> 
<ol> 
    <li>this are elements this are elements this are elements this are elements</li> 
    <li>this are elements</li> 
    <li>this are elements</li> 
</ol> 
<p>&nbsp;</p> 

with the span classes regularly loaded. However, I didn't actually *see* the difference on screen until I call the "TrackChangeDialog" box.

How can I "activate" the CssClasses of the TrackChangesDialog to work properly inside the RadEdito?


Thanks,
Federico


0
Imran
Top achievements
Rank 1
answered on 26 Sep 2018, 07:47 AM

Hi , 

I need to work for the same process of TextCompare in my c# project, but this public class Telerik.Web.UI.Editor.Diff.DiffEngine is not exposed by telerik dlls. Can you please suggest further. 

Thanks,

 

0
Rumen
Telerik team
answered on 26 Sep 2018, 11:12 AM
Hello Imran,

The Telerik.Web.UI.Editor.Diff.DiffEngine class is part of the discontinued Track Changes dialog which has been replaced by the Track Changes functionality. All functionality related to the old, non-supported dialog is still available due to legacy matters, but not support.

Since the DiffEngine is a third party source, which can be found here - http://www.mathertel.de/Diff/, I suggest following the provided site for further improvements and for using this functionality as a third-party solution.


Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Alex
Top achievements
Rank 1
Answers by
Tervel
Telerik team
federico mondini
Top achievements
Rank 2
Imran
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or