aspnetcore-js-devexpress-dot-richedit-1e8caf82.md
An event that occurs when selection is changed in the document.
export class SelectionChangedEvent extends RichEditEvent<EventArgs>
You can define the SelectionChanged event handler either at the server side, at the client side, or at runtime.
Use the OnSelectionChanged(String) method to specify the event handler.
@(Html.DevExpress().RichEdit("richEdit")
.OnSelectionChanged("function(s,e) {console.log('The current position is ' + s.selection.active);}")
// ...
Use the selectionChanged property to specify the event handler.
const options = DevExpress.RichEdit.createOptions();
options.events.selectionChanged = function(s,e) {
console.log('The current position is ' + s.selection.active);
};
The selectionChanged property provides access to the addHandler(handler), removeHandler(handler), and clearHandlers methods that allow you to dynamically add and remove event handlers.
richEdit.events.selectionChanged.addHandler(function(s, e) {
console.log('The current position is ' + s.selection.active);
});
The event handler receives an argument of the EventArgs type.
Event<TSource, TEventArgs> RichEditEvent<TEventArgs> SelectionChangedEvent
See Also