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

Track Changes in RAD Editor

5 Answers 153 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rashid
Top achievements
Rank 1
Rashid asked on 01 Apr 2008, 07:58 AM
Hi,
 I have to add features of Track Changes as given in MS word.IS anyone have used such features in RADEditor.

Regards
Rashid

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 Apr 2008, 10:06 AM
Hi Rashid,

Unfortunately, the Web based environment does not allow the implementation of an interface which is like the MS Word's one. We plan to improve the Track Changes dialog in order to be more flexible, but note once again that it won't be the same as the Word's one.

TrackChanges dialog provides a comparison between two contents. At present the implementation would compare the initial content which was in the editor when it was originally loaded on the page, with the current content - that is, it allows the user to see what changes he or she made during the editing process and before submitting content back to the server.

The editor exposes a method set_intitialContent() that, when called, will mark the current editor content as the "start" content to be used in the dialog. You can get the content which is set as initial with the get_initialContent() method. You can get the current content in the editor with editor.get_html().

You can use these methods to set and load the initial content and save its changes as history for example in a database.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Fred
Top achievements
Rank 1
answered on 20 Feb 2009, 03:20 PM
Do these methods still exists? I seem can't to find any information on these in the help documentation.  I'd like to set the initial content information in someway, so that track changes can work as normal but with the initial content I set.
0
Rumen
Telerik team
answered on 24 Feb 2009, 12:01 PM
Hi Fred,

By default the editor will use as a starting point its original content. However, you can set any other content - but you have to do it on the client-side, using the set_initialContent method.
This method accepts a string argument that should be the string against which you want to compare the content in the editor.

So, the easiest way to complete your scenario is as follows:

1. Add another editor on the page that is not visible. This editor will hold the old content. You can wrap the editor in a <div style="display:none"> RadEditor declaration here </div>

2. Add an editor that holds the new content.

3. Attach a OnClientLoad handler to the second editor, e.g. <telerik:RadEditor OnClientLoad = "OnClientLoad".../>

Add the following script above the editor declaration
<script>
function OnClientLoad(editor, arg)
{
   //Get reference to the first editor with the old content
   var oldEditor = $find("<%= RadEditor1.ClientID%>");

   //Get its content
   var html = oldEditor.get_html(true);

   //Set it as starting content to the current editor
   editor.set_initialContent(html);
}
</script>

Feel free to modify the provided solution to fit your scenario.

Best regards,
Rumen
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
Emanuele
Top achievements
Rank 2
answered on 09 Dec 2010, 12:53 PM
Please update client-side documentation on help reference.

Thanks
0
Rumen
Telerik team
answered on 09 Dec 2010, 01:41 PM
Hello Emanuele,

Thank you for your request.

I logged it in our Todo list for RadEditor documentation and we will add an article about the set_initialContent method.

All the best,
Rumen
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
General Discussions
Asked by
Rashid
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Fred
Top achievements
Rank 1
Emanuele
Top achievements
Rank 2
Share this question
or