Skip to main content

ReportDesignerPreviewClientSideEventsBuilder.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 Report Designer‘s Preview.

Namespace: DevExpress.AspNetCore.Reporting.ReportDesigner

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

NuGet Package: DevExpress.AspNetCore.Reporting

Declaration

public ReportDesignerPreviewClientSideEventsBuilder 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
ReportDesignerPreviewClientSideEventsBuilder

A ReportDesignerPreviewClientSideEventsBuilder that can be used to further configure the Report Designer Preview 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 ClientReportDesigner 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 designer = Html.DevExpress().ReportDesigner("reportDesigner1").Height("1000px")
        .Bind(Model.Report)
        .DataSources(configureDS => { foreach (var ds in Model.DataSources) { configureDS.Add(ds.Key, ds.Value); } })
        .ClientSideEvents(configure => { configure.Preview(configure => { configure.EditingFieldChanged("previewEditingFieldChanged"); }); } );
}
@designer
See Also