AjaxSpellCheck in RadEditor

28 posts, 0 answers
  1. Sambasiva
    Sambasiva avatar
    45 posts
    Member since:
    May 2008

    Posted 26 May 2008 Link to this post

    Hi,

    I have a Button and Radeditor in Page1 and upon Button click it should navigate me to another page. If the RadEditor contains any spell errors in its content it should not navigate me to Page 2 and it should alert me "Please start spell check". If there are no spell errors without any spell check it should be navigated to Page2.

    Please let me know any solution for this.

    Thanks
    Samba
  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 27 May 2008 Link to this post

    Hello Samba,

    Please, test and enhance the code below that should help you to achieve your scenario with RadEditor and its AjaxSpellChecker for ASP.NET AJAX.

    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <telerik:RadEditor ID="RadEditor1"  runat="server" >
        <ImageManager ViewPaths="~/" UploadPaths="~/" />
        <Content>
        behaviour tesr maxx
        </Content>
    </telerik:RadEditor>
    <input type="button" onclick="SpellCheckAndSubmit();return false;" value="Submit"/>
     
    <script type="text/javascript">
    function SpellCheckAndSubmit()
    {
        var editor = $find("<%=RadEditor1.ClientID%>");
        editor.fire("AjaxSpellCheck");
        setTimeout(function()
        {
            var spell = editor.get_ajaxSpellCheck();
            spell.add_spellCheckEnd(
                function(sender, args)
                {
                    editor.set_html(editor.get_html());
                    document.forms[0].submit();
                });
        }, 100);
    }
    </script>


    Best regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sambasiva
    Sambasiva avatar
    45 posts
    Member since:
    May 2008

    Posted 27 May 2008 Link to this post

    Hi Rumen,

    Thanks for your prompt reply. the piece of code given by you is not solved my scenario. After spell check, when i click the button  it is giving me a message "No mistakes found" and then it is navigating me to another page.
    I dont even want these kind of alert messages "No mistakes found" in between while navigating to Page 2. How can we restrict this alert message?

    Can you please dig and give me a detailed approach to acheive this?

  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 03 Jun 2008 Link to this post

    Hi Sambasiva,

    It appears that the RadSpell for ASP.NET AJAX does not offer the SuppressCompleteMessage property - it is supported only by the classic version of RadSpell for ASP.NET. I logged your feature request in our ToDo list and we will consider providing this property for the next update of the control. I updated your Telerik points.

    Currently, the only possible way to remove the
    "Spellchecking is complete!" alert is to modify the JS source code of the spellchecker. To do that import the external Scripts from Telerik.Web.UI.dll installation in the root of your project, open the \Scripts\Editor\AjaxSpellCheck.js file and comment or delete the following line

    alert(this._completeMessage);

    Save the file. After that set the editor's EnableEmbeddedScripts property to false and register the editor's external scripts:

    <asp:ScriptManager ID="ScriptManager1" runat="server" >
    <Scripts>
                <asp:ScriptReference Path="~/Scripts/Common/Core.js" />
                <asp:ScriptReference Path="~/Scripts/Common/PopUp/PopUpScripts.js" />          
                <asp:ScriptReference Path="~/Scripts/Editor/RadEditor.js" />
                <asp:ScriptReference Path="~/Scripts/Dialogs/DialogOpener.js" />
                <asp:ScriptReference Path="~/Scripts/Editor/Modules.js" />         
                <asp:ScriptReference Path="~/Scripts/Spell/SpellCheckService.js" />
                <asp:ScriptReference Path="~/Scripts/Editor/AjaxSpellCheck.js" />
                <asp:ScriptReference Path="~/Scripts/Window/RadWindow.js" />
    </Scripts>

    </asp:ScriptManager>

    <telerik:radeditor runat="server" EnableEmbeddedScripts="False"  ID="RadEditor1" Skin="Default">
       <Content>
         somez mistakenn contenn     
       </Content>
    </telerik:radeditor>


    Sincerely yours,
    Rumen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Paramvir
    Paramvir avatar
    3 posts
    Member since:
    Mar 2009

    Posted 15 Sep 2009 Link to this post

    Hi, i have the same problem. We dont need to show the alert message when the AJAXSpellCheck is complete in the radeditor. Have you guys provided this functionality to suppress theses messages. if Yes, then What property do i need to use to suppress these messages?
    Thanks
    Param
  7. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 18 Sep 2009 Link to this post

    Hello Paramvir,

    RadEditor does not offer API for suppressing this message, but you can achieve your goal with less steps than before. Just copy the AjaxSpellCheck.js file in the root of your application, import it with script tag under the Asp:ScriptManager and comment the //alert(this._completeMessage) line in the AjaxSpellCheck.js file.

    For your convenience I have attached my test project.

    Best regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Paramvir
    Paramvir avatar
    3 posts
    Member since:
    Mar 2009

    Posted 23 Sep 2009 Link to this post

    Hi, 

    1 i tried using the script file as suggested by you. It has suppressed the message, but now when i click spell check there is happening a script error.
    Its like this:
    Line 302
    char 1
    error: Object doesn't support this property or method
    Code: 0

    2 Can i call any javascript method to cancel/finish the Spell check?
    I need this because in my example when user press spell check it highlights the spell mistakes and makes the textbox readonly. 
    Now instead of correcting the mistakes user selects the mistake text and deletes it by pressing delete button. After deleting all mistakes the text left in textbox is correct text, but the box is still readonly. We need some method that we can call on a button click so that the textbox can become editable again.

    I want to send my code to you. Where shall i send it?

    Thanks
    Param
  9. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 28 Sep 2009 Link to this post

    Hi Param,

    Straight to the points:
    1) Did you get the error when testing  the attached project? I tried to reproduce the reported error using the sample project attached to my previous message, but without success. To show my test I attached a sample video. Could you please see it and let me know what I am missing? Please provide step-by-step instructions on how to reproduce the error on my side?

    2) In the latest Q2 2009 SP1 build of RadControls for ASP.NET AJAX it is not possible to delete the highlighted mistaken words using the Delete or Backspace keys. It is also not allowed to type and correct the misspelled word.

    That is why my recommendation is to upgrade your version of Telerik.Web.UI.dll to version 2009.2.826 (Q2 2009 SP1) and you should not experience both problems above.

    You can send zipped files, projects and images using the attachment functionality of the support ticketing system.

    Kind regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. Paramvir
    Paramvir avatar
    3 posts
    Member since:
    Mar 2009

    Posted 28 Sep 2009 Link to this post

    It took a while to receive response from your side.
    Anyways
    1 with the latest build Q2 2009 SP1, the script error no longer exists.
    2 I tested the code provided by u guys in your reply on sep 18, suppresscompletemessage.zip and i found that in Internet Explorer 7 
    its still possibe to delete the highlighted mistaken words. In Firefox it works fine.
    3 I dont see any option to attach files when i click reply in this thread. where is that option?
    4 I was rendering the radeditor as text box with previous build. Now with the latest build the appearence has changed and its now showing gray area around the left side and bottom of the text box.Please see my aspx code below:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
        <style type="text/css"> 
        /* The following CSS needs to be copied to the page to produce textbox-like RadEditor */
        .rade_wrapper_corner, .rade_wrapper_center 
        {
               display: none !important; 
        }
        .rade_leftVerticalSide, .rade_rightVerticalSide, .rade_toolZone
        {
               filter: alpha(opacity=0) !important;
               opacity: 0 !important; 
        }
        </style> 
        
       <style type="text/css">
         /*Hide toolBar*/
         .Default.rade_toolbarWrapper{ display: none; }
        </style>
        
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                var editerClientID = "<%=RadEditor1.ClientID%>";
                var headlineCharCountClientID = "<%=headlineCharCount.ClientID%>";
                
                function editorClientLoad(editor)
                {
                    var spell = editor.getToolByName("AjaxSpellCheck"); 
                    //Go up the DOM tree if needed till you *hit* the right element, e.g 
                    var parent = spell.get_element().parentNode.parentNode.parentNode.parentNode; 
                    parent.style.display = "none";
                    
                    editor.attachEventHandler(
                        "onkeyup", 
                        function(e)
                        {
                            document.getElementById(headlineCharCountClientID).innerHTML = editor.get_text().length;
                        }
                    );
                }
                
                function OnClientLoad(editor) 
                { 
                    editorClientLoad(editor);
                } 
                
                function CheckSpelling()
                {
                    var editor = $find(editerClientID)
                    editor.fire("AjaxSpellCheck")
                }
            </script>
        </telerik:RadCodeBlock>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <script type="text/javascript" src="Scripts/AjaxSpellCheck.js"></script>
            <div>
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <telerik:RadEditor ID="RadEditor1" runat="server"
                                EditModes="Design" 
                                Height="100" Width="300"
                                SpellCheckSettings-AllowAddCustom="false"
                                OnClientLoad="OnClientLoad">
                                <Tools>
                                    <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="AjaxSpellCheck" ShortCut="f7" />
                                    </telerik:EditorToolGroup>
                                </Tools>
                                <Content>
                                    Thi tex has mistajes
                                </Content>
                            </telerik:RadEditor>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <span id="headlineCharCount" runat="server"></span>
                        </td>
                    </tr>
                </table>
                
                <br />
                <asp:Button ID="btnSpellCheck" runat="server" CausesValidation="False" OnClientClick="CheckSpelling();return false;"
                    Text="Check Spelling" />&nbsp;
                    </div>
        </form>
    </body>
    </html>

  11. sowmya
    sowmya avatar
    8 posts
    Member since:
    Dec 2010

    Posted 10 Jan 2011 Link to this post

    Hi Rumen,

    I am using a Telerik Rad editor control and spell check is working on click of spell check icon of the editor.
    We need to do a spell check for Rad Editor and a text box on click of Save button.
    On save button i am calling

    onclick

     

     

    ="ExecuteCommand('AjaxSpellCheck')

     

     

     

    function ExecuteCommand(command) {

     

     

     

     

     

    $find(

     

    "radEditor").fire(command);

     

     

     

     

     

     

    }
    This works fine. This will check for spell on the rad editor on click of save button. I need to do a spell check for text box also which contains the data.
    when i had a $find("txtTextBox").fire(command); this is not identifying the text box. Please let me know how do we do call 'AjaxSpellCheck' spell check for textbox and rad editor on click on save button.

    function
    ExecuteCommand(command) {
    $find("txtTextBox").fire(command);
    $find(
    "radEditor").fire(command);

     

    }

     

  12. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 12 Jan 2011 Link to this post

    Hi,

    You cannot use the built-in spellchecker of RadEditor to spellcheck other controls. The following code is also wrong 
    $find("txtTextBox").fire(command);
    because the textbox element does not have a fire method, which applies to RadEditor only as well as you should use $get to get a reference to the TextBox.

    What you can do to achieve your scenario is to put a standalone RadSpell control on the page, set its ControlsToCheck property to the controls that you want to spellcheck and launch the spellchecker using its client side api when the content is saved.

    Best wishes,
    Rumen
    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.
  13. Hamid
    Hamid avatar
    4 posts
    Member since:
    Jun 2011

    Posted 21 Sep 2011 Link to this post

    Can i call any javascript method to cancel/finish the Spell check in Radeditor?
  14. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 22 Sep 2011 Link to this post

    Hi Hamid,

    You can use the cancelSpellCheck() method to cancel the spellchecker

    var editor = $find("<%=RadEditor1.ClientID%>");
    var spell = editor.get_ajaxSpellCheck(); 
    spell.cancelSpellCheck();


    Best wishes,
    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
  15. Hamid
    Hamid avatar
    4 posts
    Member since:
    Jun 2011

    Posted 22 Sep 2011 Link to this post

    Thank you Rumen for your quick reply
    But unfortunately it didnt work for me, the "spell" variable gets "undefined" value, so the "cancelSpellCheck()" does not run

    function doneTyping() {
                var editor = $find("<%= RadEditor1.ClientID %>");
                var spell = editor.get_ajaxSpellCheck();
                spell.cancelSpellCheck();
                ...
                ...

    And just a little question happened here, Can I get a reference to see whether Radeditor is in SpellCheck mode or not?!?

    Thank you
  16. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 23 Sep 2011 Link to this post

    Hello Hamid,

    This code will work only if the spellchecker is enabled in RadEditor.

    RadEditor provides events that are raised when a spellcheck starts and ends. The example demonstrates how to attach to these events:.

    <script type="text/javascript"> 
        function OnClientLoad(sender, args) 
        { 
          
            
            //Attach to the spellCheckLoaded event as the spell itself is loaded with AJAX 
            sender.add_spellCheckLoaded(
                function() 
                {
                    var spell = sender.get_ajaxSpellCheck(); 
                
                    spell.add_spellCheckStart(
                        function(sender, args) 
                        { 
                           //do something
                        });
                
                    spell.add_spellCheckEnd(
                        function(sender, args) 
                        {
                            //do something
                        });
                } );
            }
    </script>



    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
  17. Hamid
    Hamid avatar
    4 posts
    Member since:
    Jun 2011

    Posted 23 Sep 2011 Link to this post

    Hi Rumen
    Thank you for your time
    But unfortunately it didn't help me either
    ok lets forget about this, for now , the only thing I need is that I can check the RadEditor mode/state, to see whether its in SpellCheck mode or not?!

    i.e

    if (RadEditor is in SpellCheckMode)
        //    Do something
    else
        //    Do something else
  18. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 28 Sep 2011 Link to this post

    Hi Hamid,

    RadEditor does not offer property or method to indicate that spellcheck is currently running.

    I am not quite sure why the approach demonstrated by Rumen is not working for you. I have tested it on my side and it is working as expected. For your convenience I have attached my test page, and this video demonstrates my test.

    Best wishes,
    Dobromir
    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
  19. Ana
    Ana avatar
    9 posts
    Member since:
    Oct 2011

    Posted 30 Jul 2012 Link to this post

    Hello,

    I implemented the functionality to fire the AjaxSpellChecker automatically on submit from a button on the page. I have modified the AjaxSpellCheck.js file and commented out the alert message for 'No mistakes found' and 'Spell check complete'. I added the file into the project and it overrides the embedded file. 
    The issue is that when spell check errors are present in the RadEditor, the suggestion section does not appear. the wrong words are highlighted and the Finish Spellcheck and Cancel buttons appear, but the suggestion section is not present and this is necessary in the page. A javascript error is present in the "Error Console : TypeError: a["add_" + f] is not a function" and I could not find much information about this. Can you please tell me what to do to in order to have the functionality work correctly because I really need to remove these alerts.
    I am using the 2012.2.607.40 version for Telerik RadEditor.
    Is this functionality going to be implemented for the RadEditor AjaxSpellCheck in the future releases ?
  20. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 01 Aug 2012 Link to this post

    Hello,

    Here is an example on how to override the AjaxSpellCheck command and hide the "SpellCheck complete" message:

    <telerik:RadEditor ID="RadEditor1" runat="server">
     </telerik:RadEditor>
     <script type="text/javascript">
         Telerik.Web.UI.Editor.CommandList.AjaxSpellCheck = function (commandName, editor, args) {
             function createSpellCheckEngine() {
                 //If no spellcheck service existed so far - create it
                 if (!editor.get_ajaxSpellCheck()) {
                     var toolArgs = { "editor": editor };
                     var element = document.createElement("div");
     
                     overrideSpellCheckMethod();
                     var spell = $create(Telerik.Web.UI.Editor.AjaxSpellCheck, toolArgs, null, null, element);
     
                     //Add the module above the content area
                     var topElement = spell.get_element();
                     var topZone = $get(editor.get_id() + "Top");
                     if (topZone) topZone.appendChild(topElement);
     
                     //Set the spell and raise event that it was loaded
                     editor.set_ajaxSpellCheck(spell);
                 }
     
                 var ajaxSpell = editor.get_ajaxSpellCheck();
     
                 if (args && args.value) {
                     //Else the spellcheck will pick up the lang from its own configuration
                     ajaxSpell.set_language(args.value);
                 }
     
                 //Show the module and init spellchecking
                 ajaxSpell.spellCheck();
             }
     
             //Load the AjaxSpellChecker script on demand
             if (typeof (Telerik.Web.UI.Editor.AjaxSpellCheck) == "undefined") {
                 function OnWebRequestCompleted(executor) {
                     var script = executor.get_responseData();
                     $telerik.evalScriptCode(script);
                     createSpellCheckEngine();
                 }
     
                 var scriptRef = editor.get_ajaxSpellCheckScriptReference();
                 var wRequest = new Sys.Net.WebRequest();
                 wRequest.set_url(scriptRef);
                 wRequest.set_httpVerb("GET");
                 wRequest.add_completed(OnWebRequestCompleted);
                 wRequest.invoke();
             }
             else {
                 //script already loaded
                 createSpellCheckEngine();
             }
     
             return false;
         };
     
     
         function overrideSpellCheckMethod() {
             Telerik.Web.UI.Editor.AjaxSpellCheck.prototype.spellCheck = function () {
                  
                 //Create spell engine
                 if (!this._spellEngine) {
                      
                     this._spellEngine = new Telerik.Web.UI.Editor.SpellEngineUI(this.get_editor(), this);
     
                     //Set an onfinish handler
                     this._spellEngine.onSpellCheckComplete = Function.createDelegate(this, function () {
                         this.finishSpellCheck();
                         //alert(this._completeMessage);
                     });
     
                     //Set an add to dictionary
                     this._spellEngine.onAddCustomWord = Function.createDelegate(this, function (oWord) {
                         this.addCustomWord(oWord);
                     });
                 }
     
                 //Finish spellchecking if a previous spellcheck operation was not completed    
                 if (this._spellEngine._spellcheckComplete) {
                     this.finishSpellCheck(false); //False means not to raise a spellcheck complete event
                 }
     
                 //Show spellchecking UI
                 this._setVisible(true);
                 this._setLoadingIconVisible(true);
                 this._enableButtons(false);
     
                 this._originalHtml = this.get_editor().get_contentArea().innerHTML;
     
                 //Load the spellchecking service
                 var spell = this.getSpellService();
                 var spellCheckServiceCallback = Function.createDelegate(this, function (sender, args) {
                     spell.remove_complete(spellCheckServiceCallback);
                     this.beginSpellCheck(args);
                 });
     
                 spell.add_complete(spellCheckServiceCallback);
     
                 this._saveSpecialContent();
     
                 spell.spellCheck(this._spellEngine._escapeNewLines(this._originalHtml));
             };
         }
     </script>

    The code is tested with the latest official Q2 2012 SP1 build of RadControls for ASP.NET AJAX.

    Greetings,
    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.
  21. Ana
    Ana avatar
    9 posts
    Member since:
    Oct 2011

    Posted 03 Aug 2012 Link to this post

    Thank you for your answer, the Override method worked, I only used that in my code. Can the same be done to remove the 'No mistakes found' alert? I can't identify the exact event to override in order to remove that. Thank you.
  22. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 07 Aug 2012 Link to this post

    Hi,

    Here is how to do that:
    <telerik:RadEditor ID="RadEditor1" runat="server">
     </telerik:RadEditor>
     <script type="text/javascript">
         Telerik.Web.UI.Editor.CommandList.AjaxSpellCheck = function (commandName, editor, args) {
             function createSpellCheckEngine() {
                 //If no spellcheck service existed so far - create it
                 if (!editor.get_ajaxSpellCheck()) {
                     var toolArgs = { "editor": editor };
                     var element = document.createElement("div");
     
                     overrideSpellCheckMethod();
                     var spell = $create(Telerik.Web.UI.Editor.AjaxSpellCheck, toolArgs, null, null, element);
     
                     //Add the module above the content area
                     var topElement = spell.get_element();
                     var topZone = $get(editor.get_id() + "Top");
                     if (topZone) topZone.appendChild(topElement);
     
                     //Set the spell and raise event that it was loaded
                     editor.set_ajaxSpellCheck(spell);
                 }
     
                 var ajaxSpell = editor.get_ajaxSpellCheck();
     
                 if (args && args.value) {
                     //Else the spellcheck will pick up the lang from its own configuration
                     ajaxSpell.set_language(args.value);
                 }
     
                 //Show the module and init spellchecking
                 ajaxSpell.spellCheck();
             }
     
             //Load the AjaxSpellChecker script on demand
             if (typeof (Telerik.Web.UI.Editor.AjaxSpellCheck) == "undefined") {
                 function OnWebRequestCompleted(executor) {
                     var script = executor.get_responseData();
                     $telerik.evalScriptCode(script);
                     createSpellCheckEngine();
                 }
     
                 var scriptRef = editor.get_ajaxSpellCheckScriptReference();
                 var wRequest = new Sys.Net.WebRequest();
                 wRequest.set_url(scriptRef);
                 wRequest.set_httpVerb("GET");
                 wRequest.add_completed(OnWebRequestCompleted);
                 wRequest.invoke();
             }
             else {
                 //script already loaded
                 createSpellCheckEngine();
             }
     
             return false;
         };
     
     
         function overrideSpellCheckMethod() {
             Telerik.Web.UI.Editor.AjaxSpellCheck.prototype.spellCheck = function () {
     
                 //Create spell engine
                 if (!this._spellEngine) {
     
                     this._spellEngine = new Telerik.Web.UI.Editor.SpellEngineUI(this.get_editor(), this);
     
                     //Set an onfinish handler
                     this._spellEngine.onSpellCheckComplete = Function.createDelegate(this, function () {
                         this.finishSpellCheck();
                         //alert(this._completeMessage);
                     });
     
                     //Set an add to dictionary
                     this._spellEngine.onAddCustomWord = Function.createDelegate(this, function (oWord) {
                         this.addCustomWord(oWord);
                     });
                 }
     
                 //Finish spellchecking if a previous spellcheck operation was not completed    
                 if (this._spellEngine._spellcheckComplete) {
                     this.finishSpellCheck(false); //False means not to raise a spellcheck complete event
                 }
     
                 //Show spellchecking UI
                 this._setVisible(true);
                 this._setLoadingIconVisible(true);
                 this._enableButtons(false);
     
                 this._originalHtml = this.get_editor().get_contentArea().innerHTML;
     
                 //Load the spellchecking service
                 var spell = this.getSpellService();
                 var spellCheckServiceCallback = Function.createDelegate(this, function (sender, args) {
                     spell.remove_complete(spellCheckServiceCallback);
                     this.beginSpellCheck(args);
                 });
     
                 spell.add_complete(spellCheckServiceCallback);
     
                 this._saveSpecialContent();
     
                 spell.spellCheck(this._spellEngine._escapeNewLines(this._originalHtml));
             };
     
     
             Telerik.Web.UI.Editor.AjaxSpellCheck.prototype.beginSpellCheck = function (spellCheckResult) {
                 this._setLoadingIconVisible(false);
                 this._enableButtons(true);
     
                 //New - throw event
                 this.raiseEvent("spellCheckStart");
     
                 //No mistakes found
                 if (spellCheckResult.badWords.length == 0) {
                     this.finishSpellCheck();
                 }
                 else {
                     this._spellEngine.initialize(spellCheckResult, this._originalHtml);
                 }
             }
         }
     </script>

    The new content is highlighted.

    Greetings,
    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.
  23. Ana
    Ana avatar
    9 posts
    Member since:
    Oct 2011

    Posted 15 Apr 2013 Link to this post

    Hello,

    We are using the code you provided and we need an additional functionality to it. We are trying to restrict the validation in the RadEditor to o custom section in it. For example, if we have in the RadEditor a section between the tags
    , we don't want this section to be validated, only the text outside the tags.

    We modified the methods you described and got the text outside the text in a variable (var text) and send it to the spellcheck events instead of sending this._originalHTML. The problem we are having is that after the spellcheck is complete, the text between the quote tags is completely removed from the editor as well.

    How can we avoid this from happening?

    Regards,
    Ana
  24. Dicky
    Dicky avatar
    7 posts
    Member since:
    Mar 2010

    Posted 21 Oct 2013 Link to this post

    Hi Telerik Team,

    This is from my supervisor. It seems Telerik has spent more time responding to the problem since 2008 then just fixing it. We also don't want the alert that spell check is finished and if it was needed we need to control where it shows up. My supervisor uses a 40 inch monitor and is not looking at the top of the monitor when the RadEditor is at the bottom. Please fix this. In 2008 Rumen stated it would be fixed in the next release. What happened?

    The idea of modifying the JS source code is crazy. Do you expect your users to make this change every time Telerik issues a new release?

    As you can see he is very annoyed since this is holding up delivery of our product. If he can't use it then he figures the customer's users will have the same problem and we will be fielding many customer support calls.

    For your information we have 1000 trained user that has been trained to look at a specific location to see Error or Information messages. When I saw there were no more misspelled words I tried to click button submit and didn't know why it didn't work. then looked about 8 inches to the right and saw the alert, just bad....

    Also we cannot upgrade the Telerik.Web.UI.dll to latest version since we have been waiting for a fix on RadTextBox issue. 

    Thanks in advance.


    Best regards,

    Dicky
  25. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 22 Oct 2013 Link to this post

    Hello Dicky,

    Thank you for raising this question.

    The feature request indeed is an old one, although it has not been implemented because demand for it was rather low and there have been tasks with a higher priority in our to-do list. What Rumen said is that we will consider its implementation, yet since there were few requests for it, it didn't get implemented.

    Nevertheless, after reading the whole thread I can conclude that this feature request should be updated and refreshed in our feedback portal, so that users could vote for it and we can see if it gains more popularity. The task's priority corresponds to its popularity and the client requests we receive. Note that currently I am unable to provide a firm ETA because this idea is still pending evaluation and approval from the management.

    I can suggest tracking its progress, casting your vote and/or leaving a comment on the desired implementation by using this page: ADD properties that disable the spellcheck alerts in RadEditor.
     
    Regards,
    Ianko
    Telerik
    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 the blog feed now.
  26. Jhonny
    Jhonny avatar
    5 posts
    Member since:
    Nov 2013

    Posted 02 Oct 2015 in reply to Rumen Link to this post

    Hi. Rumen

    I want to implemente the 

     

    Telerik.Web.UI.Editor.AjaxSpellCheck.prototype.beginSpellCheck = function (spellCheckResult) {
                 this._setLoadingIconVisible(false);
                 this._enableButtons(true);

                 //New - throw event
                 this.raiseEvent("spellCheckStart");

                 //No mistakes found
                 if (spellCheckResult.badWords.length == 0) {
                     this.finishSpellCheck();
                 }
                 else {
                     this._spellEngine.initialize(spellCheckResult, this._originalHtml);
                 }
             }

     ---------------------------------------------------------------------------------

     spell.set_textSource(new function () {
                        this.get_text = function () {
                            var texts = [];
                            texts.push(params.titulo);
                            for (var i = 0; i < respuestas.length; i++)
                                texts.push(respuestas[i].titulo);
                            
                            return texts.join("<controlSeparator><br/></controlSeparator>");
                        };
                        this.set_text = function (text) {
                            var resps = text.split("<controlSeparator><br/></controlSeparator>");
                            params.titulo = resps[0];
                            for (var i = 1; i < resps.length; i++) {
                                params.respuestas[i - 1].titulo = resps[i];
                            }
                            guardarPregunta(params, page);
                        };
                    });

     

    And I haven`t  the

     <telerik:RadEditor ID="RadEditor1" runat="server">
     </telerik:RadEditor>

     

    Only

     <telerik:RadSpell ID="OrtRespuestas" Runat="server" ClientIDMode="Static" Skin="WebBlue"
                                  IsClientID="true" ButtonType="None" Language="es-ES" Width="500px"/>

     

    Thanks

  27. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 06 Oct 2015 Link to this post

    Hi,

    The beginSpellCheck function is part of the RadEditor functionality that integrates RadSpell in RadEditor. This is why it is not available with only RadSpell on the page, it is not part of the spell checking control itself.

    If you are looking into overriding the Spell control, I can suggest downloading our sources code and in RadSpell.js you will find the spellCheck() method that may help you. Note that we do not support such overrides and I cannot guarantee changing them will not cause issues, either with the current version or in a future version.

    Regards,

    Marin Bratanov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  28. Daniel
    Daniel avatar
    4 posts
    Member since:
    Feb 2016

    Posted 16 Feb in reply to Rumen Link to this post

    Hi there

    I am trying to update a project to the latest version of Telerik UI for Ajax and I see it is using the code posted above by Rumen on 07 Aug 2012, which is now failing on the line "this._spellEngine = new Telerik.Web.UI.Editor.SpellEngineUI(this.get_editor(), this);" with the error "Object doesn't support this action".  Can you advise me as to how I should be updating this to work with the new version please.

  29. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 17 Feb Link to this post

    Hello Daniel,

    This is due to UI improvements in the new version. 

    You just need to replace this line with:
    this._spellEngine = Telerik.Web.UI.Editor.SpellEngineUIFactory.getUI(this.get_editor(), this);

    Regards,
    Ianko
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017