Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Spell > How do I turn off the confirm dialog?

Not answered How do I turn off the confirm dialog?

Feed from this thread
  • Craig avatar

    Posted on Jan 17, 2012 (permalink)

    We are using RadSpell on touch screens and we cannot restyle or override the confirm dialog (pops up after you hit cancel after changing a word) for bigger buttons so I just want to get rid of it.

    OnClientCheckCancelled only fires after a selection is made in the confirm dialog and I cannot suppress it this way

    Using 
    window.confirm = function(msg){} does not work either.
    What can I do to address this?

    Reply

  • jumpstart Master avatar

    Posted on Jan 18, 2012 (permalink)

    Craig:

    You should be able to override the Window.Confirm dialog by using the RadWindowManager and a RadConfirm. This would allow you to customize its look and feel as desired. See the Working with the Confirm Dialog documentation page for insights.

    Take a look at Intercept and Manage Windows Originated by Third-party Components Hosted in C# Application for a way to intercept the dialog.

    Hope this helps!

    Reply

  • Craig avatar

    Posted on Jan 18, 2012 (permalink)

    I'm not sure I understand you.

    I want to be able to remove or replace the confirm dialog in the RadSpell control. It only appears when you change at least 1 word and then cancel the spellcheck.
    It looks like this and is identical to the regular javascript confirm dialog

    Sample here http://jsfiddle.net/rc8Us/ 


    ---------------------------------------------------------------------------
    |  Message from webpage                                                x  |
    ---------------------------------------------------------------------------
    |                                                                         |
    |   ?   Do you want to apply or cancel the changes to the text so far?    |
    |                                                                         |
    |                                           ----------   ----------       |
    |                                           |    OK   |  |  Cancel |      |
    |                                           ----------   ----------       |
    ---------------------------------------------------------------------------


    This does not appear to be a RadConfirm and overriding the window.confirm that it looks exactly like does nothing.


    Reply

  • jumpstart Master avatar

    Posted on Jan 19, 2012 (permalink)

    Craig:

    I've looked at your issue in greater depth. Sorry for the confusion.Here's what I've found.


    The only way to achieve your scenario is to Disabling embedded resources, open the SpellDialog.js file and replace the confirm function with true argument in the cancelHandler, e.g.

    Original code:
    cancelHandler: function()
    {
    if (this._cancel.disabled)
    {
    return;
    }
    //changes will be applied only if spell handler response is received, text has changed
    //and the user confirms
    this.closeDialog(this._spellProcessor && this._spellProcessor.textChanged() && confirm(this.get_localization()["Confirm"]));


    Modified
    cancelHandler: function()
    {
    if (this._cancel.disabled)
    {
    return;
    }
    //changes will be applied only if spell handler response is received, text has changed
    //and the user confirms
    this.closeDialog(this._spellProcessor && this._spellProcessor.textChanged() && true);
    }

    This should help you achieve your requirement.

    Best regards,

    Reply

  • Craig avatar

    Posted on Jan 19, 2012 (permalink)

    Wow, thanks for your indepth response jumpstart!

    That looks a bit tricky but I think I may be able to pull it off.

    :)

    Reply

  • Rumen Rumen admin's avatar

    Posted on Jan 23, 2012 (permalink)

    Hi,

    I would propose an easier way to disable the popup and it is to override the cancelHandler function. To do that follow the steps below:

    1) Create a JS file named dialog.js in the root of the web application and populate it with the following function:

    Telerik.Web.UI.Spell.SpellDialog.prototype.cancelHandler = function (e) {
        if (this._cancel.disabled) {
            return $telerik.cancelRawEvent(e);
        }
        //changes will be applied only if spell handler response is received, text has changed
        //and the user confirms
        this.closeDialog(this._spellProcessor && this._spellProcessor.textChanged() && true);
     
        return $telerik.cancelRawEvent(e);
    }

    2) Save the file and set the DialogsScriptFile property of RadSpell to point to this file, e.g.

    <telerik:RadSpell ID="RadSpell1" runat="server" ControlsToCheck="TextBox1" DialogsScriptFile="dialog.js" />
    <asp:TextBox ID="Textbox1" runat="server" />

    3) Test the solution.

    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Spell > How do I turn off the confirm dialog?
Related resources for "How do I turn off the confirm dialog?"

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