ASP.NET 3.5 and above only
Obout.Ajax.UI Controls - Spell Checker - Client side
Note |
To get or set property values for client API properties, you must call property accessor methods that are named with the get_ and set_ prefixes. For example, to get or set a value for a property such as leftMarker, you call the get_leftMarker or set_leftMarker methods:
|
var spellCheckerObject = $find("<%= spellChecker1.ClientID %>");
var _leftMarker = spellCheckerObject.get_leftMarker();
...
spellCheckerObject.set_leftMarker("[["); |
Properties
| Name |
Description |
button
|
object. Gets or sets the DOM element to initiate spell checking when clicked.
|
currentElement
|
object. Gets the DOM element currently is being spell checked.
|
elements
|
object. Gets an array of the DOM elements that the Behavior is associated with (target elements).
|
globalCheck
|
boolean. Gets or sets a value indicating whether to open one global popup for all targets.
|
id
|
string. Gets the generated identifier that consists of the ID of the associated Sys.UI.DomElement object
, the "$" character, and the name value of the Behavior object.
(Inherited from Sys.UI.Behavior.)
|
leftMarker
|
string. Gets or sets the left marker for wrapping the checking word in the target control.
Default "<=".
|
popupHolder
|
object. Gets the associated Popup Holder object.
|
popupHolderID
|
string. Gets the associated Popup Holder object ID.
|
relatedPopup
|
object.
Gets the related popup object.
It returns an object of type Obout.Ajax.UI.HTMLEditor.Popups.SpellCheckPopup or
null if the popup is not loaded yet.
|
relatedPopupClassName
|
string. Gets the related popup object's type name.
It always returns a string "Obout.Ajax.UI.HTMLEditor.Popups.SpellCheckPopup".
|
rightMarker
|
string. Gets or sets the right marker for wrapping the checking word in the target control.
Default "=>".
|
stopOnCancel
|
boolean. Gets or sets a value indicating whether to stop checking in client-side when the popup was canceled on one of the targets.
Default false.
|
Methods
| Name |
Description |
addTargetElement(element)
|
Adds a new DOM element to the targets (to be spell checked).
Parameter:
element - the DOM element to be added to the targets.
Returns:
true - the DOM element is added successfully.
false - the DOM element is not added (duplicate).
|
delTargetElement(element)
|
Removes the DOM element from the targets (to be spell checked).
Parameter:
element - the DOM element to be removed.
Returns:
true - the DOM element is removed successfully.
false - the DOM element is not removed (not found).
|
spellCheck()
|
Initiates spell checking on all target elements.
Example:
var spellCheckerObject = $find("<%= spellChecker1.ClientID %>");
spellCheckerObject.spellCheck();
|
Note |
To add or remove handler functions for client API events, you must call methods that are named with the add_ and remove_ prefixes. For example, to add or remove a handler function for an event such as checkFinished, you call the add_checkFinished or remove_checkFinished methods:
|
function checkFinishedHandler(sender, args) {
// for all TextBoxes was clicked or emulated 'OK' in SpellChecker popup?
if (args.get_targetsCount() == args.get_targetsAccepted().length) {
// yes - force submit
__doPostBack(sender.get_button().id.replace(/_/, "$"), "");
}
}
...
var spellCheckerObject = $find("<%= spellChecker1.ClientID %>");
spellCheckerObject.add_checkFinished(checkFinishedHandler);
...
spellCheckerObject.remove_checkFinished(checkFinishedHandler); |
Events
| Name |
Description |
beforeShown
|
Raised before the spell checker's popup is shown.
Event's argument has type
Sys.EventArgs.Empty.
|
checkFinished
|
Raised when spell checking is finished on all targets.
Event's argument has type
Obout.Ajax.UI.SpellChecker.CheckFinishedArgs.
See online example.
|
moveToTarget
|
Raised when the spell checker moves to some target element.
Event's argument has type
Obout.Ajax.UI.SpellChecker.MoveToTargetArgs.
|
shown
|
Raised after the spell checker's popup is shown.
Event's argument has type
Sys.EventArgs.Empty.
Example of the event handler:
function shownHandler(sender, args) {
// alert the ID of the target element for which the popup is shown
alert("Current target element's ID: " + sender.get_currentElement().id);
} |