Skip to main content

WebDocumentViewerClientSideEventsBuilder.EditingFieldChanged(String) Method

Sets the name of the JavaScript function or the entire code that will handle the EditingFieldChanged client-side event of the Web Document Viewer.

Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer

Assembly: DevExpress.AspNetCore.Reporting.v24.2.dll

NuGet Package: DevExpress.AspNetCore.Reporting

Declaration

public WebDocumentViewerClientSideEventsBuilder EditingFieldChanged(
    string callback
)

Parameters

Name Type Description
callback String

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

Returns

Type Description
WebDocumentViewerClientSideEventsBuilder

A WebDocumentViewerClientSideEventsBuilder that can be used to further configure the Document Viewer Client Side Events.

Remarks

When content editing is enabled for a report, it is possible to customize the corresponding field values in the Document Viewer. To learn how to enable this feature, refer to the Content Editing in Print Preview article. The EditingFieldChanged event enables you to respond to a change in an editing field value (for instance, to validate input data or format the edited value). When implementing a handling function, use the objects passed as parameters. The first parameter passes the event sender that is the ClientDocumentViewer object. The second one is an object with the following structure.

  • Field
    An editing field whose value has been changed.

  • OldValue
    The previous value of an editing field.

  • NewValue
    The new value of an editing field.

The code sample below demonstrates how to change an editing field’s value to the previous value if the new value does not meet the required conditions.

@{
    var documentViewer = Html.DevExpress().WebDocumentViewer("webDocumentViewer1")
        .Height("1000px")
        .Bind(Model.Report)
        .ClientSideEvents(configure => { configure.EditingFieldChanged("editingFieldChanged"); });;
}
@documentViewer
See Also