Suppress RadSpell Dialog

6 posts, 0 answers
  1. Sieg
    Sieg avatar
    3 posts
    Member since:
    Apr 2012

    Posted 27 Apr 2012 Link to this post

    I'm using a client-side API to start the spell check process.

    I'm using onchange client-side event to launch the SpellCheck dialog.

    However, the SpellCheck dialog still appears & says "The spell check is complete!" even there are no misspelled words.

    How can I suppress the SpellCheck dialog when there are no mispelled words ?

    -JScript-

     

    function MultipleTextSource(sources) {
        this.sources = sources;
        this.get_text = function () {
            var texts = [];
            for (var i = 0; i < this.sources.length; i++) {
                texts[texts.length] = this.sources[i].get_text();
            }
            return texts.join("<controlSeparator><br/></controlSeparator>");
        }
        this.set_text = function (text) {
            var texts = text.split("<controlSeparator><br/></controlSeparator>");
            for (var i = 0; i < this.sources.length; i++) {
                this.sources[i].set_text(texts[i]);
            }
        }
    }

    function spellCheck(obj, field) {
        var sources =
                   [
                   new Telerik.Web.UI.Spell.HtmlElementTextSource($get(field))
                   ];
        var spell = GetRadSpell(obj);
        spell.set_textSource(new MultipleTextSource(sources));
        spell.startSpellCheck();
    }

     

    -ASPX-

    <telerik:RadSpell ID="RadSpell1" runat="server"  />

    <asp:TextBox ID="TextBox1" runat="server" />


    -Code Behind-

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

     TextBox1.Attributes.Add("onchange", "spellCheck('" & RadSpell1.ClientID & "','" & TextBox1.ClientID & "')")

    End Sub

     

  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 27 Apr 2012 Link to this post

    Hi,

    To remove the "The Spell Check is complete!" message set the suppressCompleteMessage client property as shown below:

    <script type="text/javascript">
    function checkFinished (sender, args)
    {
       args.suppressCompleteMessage = true;
       $get('statusDiv').innerHTML = 'Spell check is complete';
    }
    </script>
    <div runat="server" id="statusDiv" />       
             
    <telerik:RadSpell
       ID="RadSpell1"
       runat="server"
       ButtonType="PushButton"
       ControlToCheck="TextBox1"
       OnClientCheckFinished="checkFinished"
    />    
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>


    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sieg
    Sieg avatar
    3 posts
    Member since:
    Apr 2012

    Posted 27 Apr 2012 Link to this post

    Hi,

    The prompt has been suppressed.. however there are few seconds delay before the radspell modal dialog disappears as well.

    How can I fix it ?

  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 02 May 2012 Link to this post

    Hi,

    The suppressCompleteMessage property hides the notification popup, but it is not possible to hide the spellcheck popup when there aren't misspelled words. This behavior is by design and cannot be customized.

    Best 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.
  6. Martha
    Martha avatar
    26 posts
    Member since:
    Aug 2011

    Posted 11 Sep 2012 Link to this post

    Is this on the list of items to implement in a future release?
    It doesn't make sense to display the spellcheck dialog when there are no spelling errors.
  7. Martha
    Martha avatar
    26 posts
    Member since:
    Aug 2011

    Posted 11 Sep 2012 Link to this post

    In case anyone else is interested, I did find an example of how to work around thiis issue using a hidden RadEditor control:
    http://www.telerik.com/community/forums/aspnet-ajax/spell/outlook-like-functionality.aspx
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017