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

Undo doesn't work for Delete and Backspace

9 Answers 203 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Caesar
Top achievements
Rank 1
Caesar asked on 28 Dec 2010, 11:10 AM
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

9 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 28 Dec 2010, 01:21 PM
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.
0
Caesar
Top achievements
Rank 1
answered on 10 Jan 2011, 01:38 PM
Hi,

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

/Rikard
0
Caesar
Top achievements
Rank 1
answered on 31 Jan 2011, 09:47 AM
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
0
Accepted
Rumen
Telerik team
answered on 31 Jan 2011, 12:34 PM
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.
0
Caesar
Top achievements
Rank 1
answered on 02 Feb 2011, 10:01 AM
Thanks!

This works just fine!!!

Regards
Caesar
0
dick
Top achievements
Rank 1
answered on 29 Jun 2011, 07:41 AM
I used the executeCommand and it works fine but if I click Redo, it doesnt work. Any suggestions?
0
Rumen
Telerik team
answered on 04 Jul 2011, 08:01 AM
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.

0
Francisco
Top achievements
Rank 1
answered on 01 Feb 2012, 07:55 PM
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
0
Francisco
Top achievements
Rank 1
answered on 01 Feb 2012, 08:57 PM
Never mind

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

Thanks
Tags
Editor
Asked by
Caesar
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Caesar
Top achievements
Rank 1
dick
Top achievements
Rank 1
Francisco
Top achievements
Rank 1
Share this question
or