Skip to main content
A newer version of this page is available. .
JS

RichEditBuilder.OnDocumentLoaded(String) Method

Assigns an event handler to a client event that occurs when a document model is loaded into the control.

Namespace: DevExpress.AspNetCore.RichEdit

Assembly: DevExpress.AspNetCore.RichEdit.v19.2.dll

Declaration

public RichEditBuilder OnDocumentLoaded(
    string callback
)

Parameters

Name Type Description
callback String

The name of a JavaScript function or the entire JavaScript function code used to handle an event.

Returns

Type Description
RichEditBuilder

An object that can be used to further configure the Rich Text Editor.

Remarks

The event handler receives an argument of the EventArgs type. The argument’s properties provide information specific to this event.

function onDocumentLoaded(s, e) {
    s.document.insertText(0, 'Dear Mr Stanley,');
    s.document.insertParagraph(s.document.length);
    var startPosition = s.document.length;
    s.document.insertParagraph(startPosition);
    s.document.insertText(startPosition, '[Type your text here]');
    s.selection.setSelection(new DevExpress.RichEdit.Interval(startPosition, s.document.length - startPosition));
    s.focus();
}

For a full example, see Ribbon Customization demo.

See Also