Forums

Disable spell checker

Last post 5/26/2009 6:32 AM by Stijn Van Loo (e-novex). 2 replies.
Sort Posts: Previous Next
  • Stijn Van Loo (e-novex)

    Disable spell checker

    5/24/2009 5:24 PM
    • Not Ranked
    • Joined on 7/15/2007
    • Posts 28

    How can I disable the spell checker, more than only hiding the button (which I know how to), but disable its functionality.

  • Andrew R (Developer Express)

    Re: Disable spell checker

    5/25/2009 4:09 AM

    Hi!

    Please, try the following code:

    <dxhe:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server">

        <Toolbars>

            <dxhe:CustomToolbar>

                <Items>

                    <dxhe:CustomToolbarButton CommandName="CustomSpellChecking"

                        Text="CustomSpellChecking">

                    </dxhe:CustomToolbarButton>

                </Items>

            </dxhe:CustomToolbar>

        </Toolbars>

        <ClientSideEvents CustomCommand="function(s, e) { OnCustomCommand(s, e.commandName); }" />

    </dxhe:ASPxHtmlEditor>

     

    <script type="text/javascript">

        function OnCustomCommand(htmlEditor, commandName) {

            if (commandName == "CustomSpellChecking") {

                CustomSpellChecking(htmlEditor);

            }

        }

        function CustomSpellChecking(htmlEditor) {

            var html = htmlEditor.GetHtml();

            if (html != "<p></p>") // some conditions

                htmlEditor.ExecuteCommand(ASPxClientCommandConsts.CHECKSPELLING_COMMAND);

        }

    </script>

    Let me know whether this code helps you.

  • Stijn Van Loo (e-novex)

    Re: Disable spell checker

    5/26/2009 6:32 AM
    • Not Ranked
    • Joined on 7/15/2007
    • Posts 28

    Thanks for the code! Now I've seen that the red underlining (only) shows in Chrome and not in IE/FF, so it has nothing to do with the html editor itself. Thanks.

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.