WebDocumentViewerClientSideEventsBuilder.ParametersReset(String) Method

Specifies the JavaScript function that handles the client-side ParametersReset event.

Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer

Assembly: DevExpress.AspNetCore.Reporting.v21.1.dll

Declaration

public WebDocumentViewerClientSideEventsBuilder ParametersReset(
    string callback
)

Parameters

Name Type Description
callback String

The name of a JavaScript function or entire JavaScript function code that runs when the ParametersReset event is fired.

Returns

Type Description
WebDocumentViewerClientSideEventsBuilder

A WebDocumentViewerClientSideEventsBuilder that can be used for method chaining.

Remarks

The ParametersReset event is raised when the user clicks the Reset button in the Preview Parameters panel. The ResetParameters method also raises the ParametersReset event.

The event handler function receives the following parameters:

  • Event sender (the client Document Viewer object that exposes the IPreviewModel interface)
  • An object that exposes two properties:
    • ParametersViewModel
      A View Model for report parameters.
    • Parameters
      Report parameters whose values were reset.

The following code collapses the Parameters panel after parameter values are reset:

<script type="text/javascript" id="script"> 
    function parametersReset(s, e) {
        var preview = s.GetPreviewModel();
        if (preview) {
            preview.tabPanel.collapsed(true);
        }
    }
</script>

@{
    var viewerRender = Html.DevExpress().WebDocumentViewer("DocumentViewer")
        .Height("1000px")
        .ClientSideEvents(configure => configure.ParametersReset("onParametersReset"))
        .Bind("TestReport");
    @viewerRender.RenderHtml()
}
See Also