Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

SpellChecker - Customizing built-in dialogs

$
0
0
In this example you can learn how to customize spell checking dialogs of ASP.NET  MVC Spell Checker.
ASP.NET  MVC Spell Checker provides two built-in forms - one form allows the end-user to accept or reject spelling suggestion and update a custom dictionary with a new word (SpellCheckForm), the other enables changing spell checking options (SpellCheckOptionsForm). 

To render a custom SpellCheckForm,  use the SpellCheckerSettings.SettingsForms.SpellCheckFormAction property to specify a custom controller action CustomSpellCheckFormPartial. The action CustomSpellCheckFormPartial renders a partial view which contains a custom dialog. In this example the custom dialog is the same as the default built-in dialog, to illustrate the method.  Subsequently you can modify it as your needs dictate.

When modifying the CustomSpellCheckFormPartial view, you should follow the guidelines below.
1. Use the private client-side Javascript event handlers to interact with the SpellChecker object. Their names are shown in the following picture.


2. Do not change ID of any element on the form (editors, buttons, the <div> element). They should be the same as the names in this example.
3. The <div> element in the dialog (the element that displays the original text with misspelled words underlined) should have the ID conforming to the pattern <SpellCheckerExtensionName>_SpellCheckForm_SCCheckedDiv
4. Themed <div> element is of the dxwscCheckedTextContainer class to use the Default theme. The dxwscCheckedTextContainer_<themename> class specifies the theme themename.

To render a custom SpellCheckOptionsForm,  use the SpellCheckerSettings.SettingsForms.SpellCheckOptionsFormAction property to specify a custom controller action CustomSpellCheckOptionsFormPartial. The action CustomSpellCheckOptionsFormPartial renders a partial view which contains a custom dialog. In this example the custom dialog is the same as the default built-in dialog.  Subsequently you can modify it as your needs dictate.
When modifying the CustomSpellCheckOptionsFormPartial view, use the private client-side Javascript event handlers as shown in the following picture.





Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>