Skip to content
This repository has been archived by the owner. It is now read-only.

Latest commit

 

History

History
66 lines (53 loc) · 2.41 KB

File metadata and controls

66 lines (53 loc) · 2.41 KB
title Syncfusion SpellCheck - Customization | JavaScript
description Customization in Syncfusion Essential Studio JavaScript spellcheck control, its elements and more details.
platform js
control spellcheck
documentation ug
keywords customization, spellcheck customization, misspell word appearance, restrict suggestion count
api /api/js/ejspellcheck

SpellCheck Customization in JavaScript

The Essential JavaScript SpellCheck provides option to customize for the following scenarios.

  • Misspell Word Appearance
  • Restrict Suggestion Count

Misspell Word Appearance

The SpellCheck control provide the support(misspellWordCss) to display the error word in user defined style. By default displaying the error words with the red underline.

The following code example depicts the way to customize the error word highlight (displaying error word with red color font and lightblue background).

{% highlight html %}

<script type="text/javascript">
    $(function () {
        $("#SpellCheck").ejSpellCheck({
            misspellWordCss: "highlight",
            dictionarySettings: {
                dictionaryUrl: "http://js.syncfusion.com/demos/ejservices/api/SpellCheck/CheckWords",
                customDictionaryUrl: "http://js.syncfusion.com/demos/ejservices/api/SpellCheck/AddToDictionary"
            }
        });
    });
</script>
<style>
    .highlight {
        background-color: lightblue;
        color: red;
    }
</style> 

{% endhighlight %}

Restrict Suggestion Count

The SpellCheck control provides option (maxSuggestionCount) to restrict the count that the number of items displayed in the suggestion list.

The following code example describes the way to control the suggestion count.

{% highlight html %}

<script type="text/javascript">
    $(function () {
        $("#SpellCheck").ejSpellCheck({
            maxSuggestionCount: 3,
            dictionarySettings: {
                dictionaryUrl: "http://js.syncfusion.com/demos/ejservices/api/SpellCheck/CheckWords",
                customDictionaryUrl: "http://js.syncfusion.com/demos/ejservices/api/SpellCheck/AddToDictionary"
            }
        });
    });
</script>

{% endhighlight %}