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

Tracking Changes

4 Answers 160 Views
Editor
This is a migrated thread and some comments may be shown as answers.
İsyazilim
Top achievements
Rank 1
İsyazilim asked on 06 Jul 2010, 09:34 AM
Hi,
    I set initial content while page_loaded. After i change content i can see changes by clicking track changes button.
    But there is a scenerio like this.
    First user writes a content and saves.(xml, sql etc.)
    Second user opens saved content (Page_Load)
    Makes changes and saves again.
    First user opens document. User wants to see changes made by second user. 
    How?

    Thanks.
   

4 Answers, 1 is accepted

Sort by
0
Accepted
Dobromir
Telerik team
answered on 08 Jul 2010, 11:11 AM
Hi Ugur,

I already answered your support ticket on the same subject. For convenience I will paste my answer here as well:

I will try to explain in more detail how the Track Changes dialog and its API works, so that you can implement your scenario:
    • editor.set_intitialContent() - marks the current editor content as the "start" content to be used in the dialog:

              <script type="text/javascript">
              function setContent()
              {
                  //Sets editor's current content as initial
                  <%= RadEditor1.ClientID%>.set_intitialContent();
              }
              </script>
               <telerik:radeditor id="RadEditor1" runat="server"></telerik:radeditor>
               <asp:button id="Button" cssclass="button" runat="server" onclientclick="setContent" text="Set editor's current content as initial" />

      If you hit the submit button it will fire the setContent function, which will execute the set_intitialContent() method and set the initial content. After that, edit the content and press the Track Changes tool button. The dialog will be loaded, and will show the differences between the initially set content by the set_intitialContent() method and the content placed in the content area.
      • editor.get_initialContent() - returns the content which is set as initial.
      • editor.get_html(true) - returns the content in the content area of RadEditor
      • editor.set_html(content) - set the supplied by the content argument content in the editor
        You can test and see how the dialog works in the following example: Dialogs.

        Here is a sample scenario how you can proceed:
        1. load some content in the editor from your Database
        2. Set the content in the editor using the editor.set_html(contentFromDb) method
        3. Set the loaded content as initial using editor.set_initialContent()
        4. Edit content
        5. Compare the initial and the lastly created / edited content by opening the Track Changes dialog
        6. If you like the lastly edited content then obtain it using editor.get_html() method and save it in your DataBase.

        Greetings,
        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
        İsyazilim
        Top achievements
        Rank 1
        answered on 08 Jul 2010, 11:39 AM
        Thanks for detailed description.
        0
        Idrise
        Top achievements
        Rank 1
        answered on 06 Mar 2013, 05:38 PM
        Could I modify this approach to show changes between two saved versions of content (tracking changes) before the user even edits the content?

        So 1, set the content to version 1 content
        2. call set_initialContent()
        3. set the content to version 2 content
        4.  Assume the user does not want to make any additional edits, he just wants to view the changes between version 1 and version 2. ... would this work?
        5. If the user did want to make additional edits and change tracking worked between v1 and v2, would that work?

        Another alternative, if possible, could be to simply save the change tracking mark up separately after each save.  We could use this to show users the differences between versions while still saving the latest version's plain content separately.  However, I don't know if there's a method in the API to get the content with the mark up of changes.  I'll need some feedback for that

        Thanks!!!
        0
        Rumen
        Telerik team
        answered on 11 Mar 2013, 01:39 PM
        Hi,

        The track changes dialog just compares the initial content and the current content. You can see the initial content by firing the set_initialContent() client method. This will work for changed or unchanged content.

        A more enhanced track changes collaboration functionality is offered by the latest Q1 2013 version of RadEditor, which you can test in the following live demo: Track Changes.

        Greetings,
        Rumen
        the Telerik team
        If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
        Tags
        Editor
        Asked by
        İsyazilim
        Top achievements
        Rank 1
        Answers by
        Dobromir
        Telerik team
        İsyazilim
        Top achievements
        Rank 1
        Idrise
        Top achievements
        Rank 1
        Rumen
        Telerik team
        Share this question
        or