Tracking Changes

5 posts, 1 answers
  1. İsyazilim
    İsyazilim avatar
    8 posts
    Member since:
    Jul 2010

    Posted 06 Jul 2010 Link to this post

        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. 

  2. Answer
    Dobromir avatar
    1633 posts

    Posted 08 Jul 2010 Link to this post

    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();
                 <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.

          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
        1. İsyazilim
          İsyazilim avatar
          8 posts
          Member since:
          Jul 2010

          Posted 08 Jul 2010 Link to this post

          Thanks for detailed description.
        2. Idrise
          Idrise avatar
          2 posts
          Member since:
          Mar 2010

          Posted 06 Mar 2013 Link to this post

          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

        3. Rumen
          Rumen avatar
          14316 posts

          Posted 11 Mar 2013 Link to this post


          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.

          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.
        Back to Top