Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Editor > Undo doesn't work for Delete and Backspace

Answered Undo doesn't work for Delete and Backspace

Feed from this thread
  • Caesar avatar

    Posted on Dec 28, 2010 (permalink)

    Hi,

    If there is an existing text in the editor, setting focus by clicking and then pressing delete or backspace to delete text, then the undo button isn't enabled.

    Even after typing some other text, and then deleting with delete-key, the undo/redo-chain isn't working as expected.

    This doesn't work in the demo either:
    http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx

    Regards
    Rikard

    Reply

  • Rumen Rumen admin's avatar

    Posted on Dec 28, 2010 (permalink)

    Hello Rikard,

    The delete / backspace commands are not included into the Undo list to prevent editing performance problems when working with large content.

    Nevertheless, the requested Undo/Redo functionality is already logged in our PITS system and you can vote for it here: http://www.telerik.com/support/pits.aspx#/public/aspnet-ajax/1672.

    We will raise its priority if more users request this feature.

    Best regards,
    Rumen
    the Telerik team
    Browse the vast support resources we have to jump start 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.

    Reply

  • Caesar avatar

    Posted on Jan 10, 2011 (permalink)

    Hi,

    I (and everybody I have asked in my office) thinks deletions are even more important to undo than typing...

    /Rikard

    Reply

  • Caesar avatar

    Posted on Jan 31, 2011 (permalink)

    Hi,

    Is there any other solution for this? For example replacing some internal telerik javascript method?
    No one that I have asked understands why there is an undo button that doesn't undo deletions...

    Regards
    Caesar

    Reply

  • Answer Rumen Rumen admin's avatar

    Posted on Jan 31, 2011 (permalink)

    Hello Caesar,

    Please, try the following JavaScript function that will enable the DeleteKey command in the Undo / Redo list:

    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad">
    </telerik:RadEditor>
    <script type="text/javascript">
    function OnClientLoad(editor, args)
    {
        editor.attachEventHandler("onkeydown", function (e) {
            if (e.keyCode == 8 || e.keyCode == 46) {
                var oCmd = new Telerik.Web.UI.Editor.GenericCommand("DeleteKey", editor.get_contentWindow(), editor);
                editor.executeCommand(oCmd);
            }
        });
    }
    </script>



    Best regards,
    Rumen
    the Telerik team
    Browse the vast support resources we have to jump start 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.

    Reply

  • Caesar avatar

    Posted on Feb 2, 2011 (permalink)

    Thanks!

    This works just fine!!!

    Regards
    Caesar

    Reply

  • dick avatar

    Posted on Jun 29, 2011 (permalink)

    I used the executeCommand and it works fine but if I click Redo, it doesnt work. Any suggestions?

    Reply

  • Rumen Rumen admin's avatar

    Posted on Jul 4, 2011 (permalink)

    Hi Dick,

    Could you please provide detailed steps to reproduce the problem? Right now I am unable to reproduce the issue as shown in the following video: http://screencast.com/t/rFufKIvd.

    Best wishes,
    Rumen
    the Telerik team

    Browse the vast support resources we have to jump start 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.

    Reply

  • Francisco avatar

    Posted on Feb 1, 2012 (permalink)

    Hi, I have tried this solution and is not working for me.

    I have seen that in my case the OnClientLoad="OnClientLoad" is not doing anything, the function is not being triggered.

    In my case I have the RadEditor inside of a Telerik:RadTabStrip as follows:

       <telerik:RadTabStrip ID="ResourceTabContainer" runat="server" SelectedIndex="0" MultiPageID="RadMultiPage">
                                    <Tabs>
                                        <telerik:RadTab Text="Editor" PageViewID="EditorTab" Value="EditorTab">
                                        </telerik:RadTab>
                                    </Tabs>
                                </telerik:RadTabStrip>
                                <telerik:RadMultiPage ID="RadMultiPage" runat="server" SelectedIndex="0">
                                    <telerik:RadPageView ID="EditorRadPageView" runat="server">
                                        <telerik:RadEditor ID="ResourceValueEditor" runat="server" SkinID="BasicSetOfTools" OnClientLoad="OnClientLoad"
                                            Width="100%" Height="400px" StripFormattingOnPaste="MSWordRemoveAll">
                                            <SpellCheckSettings spellcheckprovider="EditDistanceProvider"></SpellCheckSettings>
                                        </telerik:RadEditor>
                                    </telerik:RadPageView>
                                </telerik:RadMultiPage>

    And my java script function is this:

    function OnClientLoad(editor, args) {
       alert("OnClientLoad function called");
                editor.attachEventHandler("onkeydown", function (e) {
                    if (e.keyCode == 8 || e.keyCode == 46) {
                        var oCmd = new Telerik.Web.UI.Editor.GenericCommand("DeleteKey", editor.get_contentWindow(), editor);
                        editor.executeCommand(oCmd);
                    }
                });
            }

    But I can't even see the "OnClientLoad function called"  message.

    Could you please tell me what could be the problem?

    Thanks in advance

    Reply

  • Francisco avatar

    Posted on Feb 1, 2012 (permalink)

    Never mind

    The problem was an overwrite for the OnClientLoad event from the code behind that I wasn't aware of.

    Thanks

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Editor > Undo doesn't work for Delete and Backspace
Related resources for "Undo doesn't work for Delete and Backspace"

ASP.NET Editor Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]