Document editor supports performing spell checking for any input text. You can perform spell checking for the text in Document Editor and it will provide suggestions for the mis-spelled words through dialog and in context menu.
@Html.EJS().DocumentEditor("container").IsReadOnly(false).EnableEditor(true).EnableSelection(true).EnableSpellChecker(true).Render()
<script>
var documenteditor;
document.addEventListener('DOMContentLoaded', function () {
documenteditor = document.getElementById("container").ej2_instances[0];
documenteditor.spellChecker.languageID = 1033 //LCID of "en-us";
documenteditor.spellChecker.removeUnderline = false;
documenteditor.spellChecker.allowSpellCheckAndSuggestion = true;
});
</script>
By default, mis-spelled words are marked with squiggly line. You can also disable this behavior by enabling the removeUnderline
API and now, the squiggly lines will never be rendered for mis-spelled words.
this.container.documentEditor.spellChecker.removeUnderline = false;
By default, on performing spell check in Document Editor, both spelling and suggestions of the mis-spelled words will be retrieved, and this mis-spelled words can be corrected through context menu suggestions. You can modify this behavior using the allowSpellCheckAndSuggestion
API, which will perform only spell check.
this.container.documentEditor.spellChecker.allowSpellCheckAndSuggestion = false;
Document Editor provides multi-language spell check support. You can add as many languages (dictionaries) in the server-side and to use that language for spell checking in Document Editor, it must be matched with languageID
you pass in the Document Editor.
this.container.documentEditor.spellChecker.languageID = 1033; //LCID of "en-us";