disable/enable breaks customDialog

5 posts, 1 answers
  1. Echarbeneau
    Echarbeneau avatar
    21 posts
    Member since:
    Nov 2006

    Posted 24 Nov 2008 Link to this post

    I have a working custom dialog box. However, when I disable the editor and later enable the editor the custom dialog will no longer work. The only work around that I have found is setting the editMode to Preview/All instead of enable/disable, but this is not ideal.

    Both Q2 and Q3 versions have this issue. I am currently using the Q3, I upgraded with hopes it would fix the problem.

    Regards,
    Ed C.
  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 27 Nov 2008 Link to this post

    Hi Echarbeneau,

    I tried to reproduce the problem but unfortunately without success. You can see my test in the attached project as well as test my project. Could you please modify it so that I can reproduce the problem on my side?

    Thank you in advance.


    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Echarbeneau
    Echarbeneau avatar
    21 posts
    Member since:
    Nov 2006

    Posted 02 Dec 2008 Link to this post

    Thank you for the prompt reply. I found the combination that causes failure.

    The RadEditor is set to enabled = false by default.
    The RadEditor is linked to a RadAjaxManager
    Download Error Example
  5. Answer
    Nikolay Raykov
    Admin
    Nikolay Raykov avatar
    102 posts

    Posted 05 Dec 2008 Link to this post

    Hello Ed,

    In order to get your custom dialogs to work you should register your script into the page when you make an AJAX request. This is done by using the ScriptManager's methods for registering script inside an UpdatePanel control. Here you can find more information about this control and these methods specifically:

    http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.aspx

    For your convenience I have attached your aspx page with the changes I made. In the button click event handler I register your script with the ScriptManager's RegisterClientScriptBlock method. You can use it as a reference in your project.

    Kind regards,
    Nikolay Raykov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Echarbeneau
    Echarbeneau avatar
    21 posts
    Member since:
    Nov 2006

    Posted 05 Dec 2008 Link to this post

    Thank you!

    Update:
    I was still having some issues with the final implementation. There were some additional features that I was trying to use such as editor.pastHTML and passing arguments between the dialog/editor. The best solution was using Scriptmanager.RegisterStartupScript on the Page_Load event. Thanks for pointing me in the right direction.

    Below is example code that relates to the Telerix demo page found at Editor > Tools > Custom Dialogs
    Dim script As String = "Telerik.Web.UI.Editor.CommandList[""InsertSpecialLink""] = function(commandName, editor, args){var elem = editor.getSelectedElement();" + _ 
    "if (elem.tagName == ""A"") {editor.selectElement(elem);argument = elem;}  else {var content = editor.getSelectionHtml(); var link = editor.get_document().createElement(""A""); link.innerHTML = content; argument = link;}" + _ 
                "var myCallbackFunction = function(sender, args) { editor.pasteHtml(String.format(""<a href={0} target='{1}' class='{2}'>{3}</a> "", args.href, args.target, args.className, args.name)) };" + _ 
                "editor.showExternalDialog(" + _ 
                "'InsertLink.aspx'," + _ 
                "argument," + _ 
                "270," + _ 
                "300," + _ 
                "myCallbackFunction," + _ 
                "null," + _ 
                "'Insert Link'," + _ 
                "true," + _ 
                "Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move," + _ 
                "false," + _ 
                "false);" + _ 
            "};" 
            ScriptManager.RegisterStartupScript(MeGetType(Page), "InsertSpecialLink", script, True

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017