RadEditor Save and Cancel buttons

5 posts, 1 answers
  1. DW Web Team Member
    DW Web Team Member avatar
    43 posts
    Member since:
    Jun 2012

    Posted 14 Sep 2010 Link to this post

    I try to add the Save and Cancel buttons to a RadEditor’s Toolbar by using the approach on the http://www.telerik.com/help/aspnet-ajax/addingsaveandcancelbuttonstoolbar.html page. When I run the code, I have the javascript error: “Microsoft JScript runtime error: 'RadEditorCommandList' is undefined”. Could you please let me know what I am missing?
    Thank you

  2. Answer
    Rumen avatar
    14316 posts

    Posted 15 Sep 2010 Link to this post


    You should wrap the Telerik.Web.UI.Editor.CommandList function in if (typeof (RadEditorCommandList) != "undefined"){ } check so that when the editor is not rendered on the page the undefined error to not pop up, e.g.

    <telerik:radeditor runat="server" ID="RadEditor1" Enabled="false"> 
                <telerik:EditorTool Name="Save" /> 
    <script type="text/javascript"> 
        if (typeof (RadEditorCommandList) != "undefined")  
            Telerik.Web.UI.Editor.CommandList["Save"] = function(commandName, editor, args)  
                var btnSubmit = $get("<%=btnSubmit.ClientID%>"); //get a reference to the Asp:Button 
                btnSubmit.click(); //click it programmatically 
    <asp:Button style="display:none;" ID="btnSubmit" runat="server" Text="Submit" /> 

    If you scenario is other, please open a support ticket and send a sample working project that demonstrates the error.

    Sincerely yours,
    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
  3. DW Web Team Member
    DW Web Team Member avatar
    43 posts
    Member since:
    Jun 2012

    Posted 15 Sep 2010 Link to this post

    Of course! Thank you very much!!!
  4. Jon Shipman
    Jon Shipman avatar
    43 posts
    Member since:
    Nov 2009

    Posted 07 Jan 2011 Link to this post

    My editor starts with Enabled="false" so I have this issue as well.  I'm using an ajaxified linkbutton click to enable the ajaxified editor.

    So wrapping the script prevents it from running when the editor is not enabled, but enabling it through ajax doesn't run the script.

    I'm having trouble figuring out how and when to get the script to run.  Can you help?  Thanks!
  5. Dobromir
    Dobromir avatar
    1633 posts

    Posted 10 Jan 2011 Link to this post

    Hi Jon,

    I already answered your support ticket on the subject. For convenience I will paste my answer here as well:

    This alert occurs because RadEditor's custom commands are registered as a inline JavaScript and such scripts are not executed again after AJAX update.

    You can find more detailed information and solutions to for this scenario in the following blog post:

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