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

Suppress RadSpell Dialog

5 Answers 120 Views
Spell
This is a migrated thread and some comments may be shown as answers.
Sieg
Top achievements
Rank 1
Sieg asked on 27 Apr 2012, 07:47 AM

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

 

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 27 Apr 2012, 09:12 AM
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.
0
Sieg
Top achievements
Rank 1
answered on 27 Apr 2012, 09:26 AM
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 ?

0
Rumen
Telerik team
answered on 02 May 2012, 08:57 AM
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.
0
Martha
Top achievements
Rank 1
answered on 11 Sep 2012, 03:08 PM
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.
0
Martha
Top achievements
Rank 1
answered on 11 Sep 2012, 06:20 PM
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
Tags
Spell
Asked by
Sieg
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Sieg
Top achievements
Rank 1
Martha
Top achievements
Rank 1
Share this question
or