Approved
Last Updated: 07 Jun 2016 07:53 by ADMIN
ADMIN
Ianko
Created on: 20 Dec 2013 09:01
Category: Editor
Type: Feature Request
0
Improve the RadEditor's client-side API, so that developers could interact with Track Changes programmatically
This would be needed in cases when the developers desire to create a logic which accepts all changes on Client-side without alerting any messages to the user. 

For the time being you can use the following example have more control over the Track Changes feature on the client:

 <telerik:RadEditor ID="RadEditor1" runat="server" EnableTrackChanges="true">
     <Content>
         <p>Some text</p>
     </Content>
     <TrackChangesSettings CanAcceptTrackChanges="true" />
 </telerik:RadEditor>

 <telerik:RadButton runat="server" ID="RadButton1" AutoPostBack="false" 
     OnClientClicked="OnClientClicked" Text="Accept Changes!"/>

 <script type="text/javascript">
     function OnClientClicked(sender) {
         var editor = $find("<%= RadEditor1.ClientID  %>");
         var trackChanges = Telerik.Web.UI.Editor.TrackChanges;

         trackChanges.setEditor(editor);

         /* use acceptAllChanges() method to prompt the user 
         whether to accept or not accept the changes */

         //trackChanges.acceptAllChanges();

         /* use acceptAllChangesSilently() method to directly 
         accept changes without notifying the user */

         trackChanges.acceptAllChangesSilently();
     }
 </script>
0 comments