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

RadEditor track Changes popup windows

5 Answers 67 Views
Editor
This is a migrated thread and some comments may be shown as answers.
diane
Top achievements
Rank 1
Veteran
diane asked on 30 May 2020, 11:35 AM

When EnableTrackChanges = true and after the user makes changes ..... and Accept All Track Changes or Reject All Track Changes a popup window is displayed. How do i disable or hide the popup windows? 

 

thanks in advance

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Jun 2020, 01:38 PM

Hi Diane,

Here is an example on how to skip the choice-related popup step:

<script>
    function OnClientCommandExecuted(sender, args) {
        if (args.get_commandName() == "AcceptAllTrackChanges") {
            setTimeout(function () {
                console.log($telerik.$(".rePopupContainer .rePopupButton.ok").click());
            }, 0);
        }
        else if (args.get_commandName() == "RejectAllTrackChanges") {
            setTimeout(function () {
                console.log($telerik.$(".rePopupContainer .rePopupButton.ok").click());
            }, 0);
        }
    }
</script>
<telerik:RadEditor RenderMode="Lightweight" ID="theEditor" EnableTrackChanges="true" runat="server" Width="750px"
    Height="400px" OnClientCommandExecuted="OnClientCommandExecuted">
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="AcceptAllTrackChanges" />
            <telerik:EditorTool Name="RejectAllTrackChanges" />
        </telerik:EditorToolGroup>
    </Tools>
    <TrackChangesSettings Author="RadEditorUser" CanAcceptTrackChanges="true" UserCssId="reU0"></TrackChangesSettings>
</telerik:RadEditor>

Another approach is to override the command's logic and change the way changes are accepted:

        <telerik:RadEditor runat="server" ID="RadEditor1" EnableTrackChanges="true">
            <Tools>
                <telerik:EditorToolGroup>
                    <telerik:EditorTool Name="AcceptAllTrackChanges" />
                    <telerik:EditorTool Name="RejectAllTrackChanges" />
                </telerik:EditorToolGroup>
            </Tools>
            <TrackChangesSettings Author="RadEditorUser" CanAcceptTrackChanges="true" UserCssId="reU0"></TrackChangesSettings>
        </telerik:RadEditor>

        <script>
            Telerik.Web.UI.Editor.CommandList.AcceptAllTrackChanges = function (commandName, editor, args) {
                Telerik.Web.UI.Editor.TrackChanges.setEditor(editor);
                Telerik.Web.UI.Editor.TrackChanges.acceptAllChangesSilently();
                return true;
            };
        </script>


Note that the script should be always the RadEditor declaration so that the namespace and the command to be initialized on the client properly before compiling the override.

 

Regards,
Rumen
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
diane
Top achievements
Rank 1
Veteran
answered on 03 Jun 2020, 03:25 PM

Thank You Rumen .... the 1st option will work best in my case ... however it doesn't take care of the 2nd popup (confirmation) ... i don't want any popups to be display .... 

 

 

0
Rumen
Telerik team
answered on 03 Jun 2020, 03:33 PM

You are welcome, Diane!

You can find below an improved version of the second approach that covers the Reject option too - works without any popups - Enjoy:

<telerik:RadEditor runat="server" ID="RadEditor1" EnableTrackChanges="true">
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="AcceptAllTrackChanges" />
            <telerik:EditorTool Name="RejectAllTrackChanges" />
        </telerik:EditorToolGroup>
    </Tools>
    <TrackChangesSettings Author="RadEditorUser" CanAcceptTrackChanges="true" UserCssId="reU0"></TrackChangesSettings>
</telerik:RadEditor>

<script>
    Telerik.Web.UI.Editor.CommandList.AcceptAllTrackChanges = function (commandName, editor, args) {
        Telerik.Web.UI.Editor.TrackChanges.setEditor(editor);
        Telerik.Web.UI.Editor.TrackChanges.acceptAllChangesSilently();
        return true;
    };
    Telerik.Web.UI.Editor.CommandList.RejectAllTrackChanges = function (commandName, editor, args) {
        Telerik.Web.UI.Editor.TrackChanges.setEditor(editor);
        Telerik.Web.UI.Editor.TrackChanges.rejectAllChangesSilently();
        return true;
    };
</script>

Regards,
Rumen
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
diane
Top achievements
Rank 1
Veteran
answered on 03 Jun 2020, 08:16 PM
Thank you so much...this is exactly what i need.
0
Rumen
Telerik team
answered on 04 Jun 2020, 08:41 AM

Great! I am glad that everything is fine! Keep up the good work :)

 

Regards,
Rumen
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Editor
Asked by
diane
Top achievements
Rank 1
Veteran
Answers by
Rumen
Telerik team
diane
Top achievements
Rank 1
Veteran
Share this question
or