Skip to main content

DxDocumentViewerCallbacks.PreviewClick Property

Specifies the handler for the PreviewClick client-side event that occurs when the user clicks the document area in the Web Document Viewer.

Namespace: DevExpress.Blazor.Reporting

Assembly: DevExpress.Blazor.Reporting.v23.2.JSBasedControls.Common.dll

NuGet Package: DevExpress.Blazor.Reporting.JSBasedControls.Common

Declaration

[Parameter]
public string PreviewClick { get; set; }

Property Value

Type Description
String

The name of a JavaScript function used to handle the PreviewClick event.

Remarks

The PreviewClick event occurs when the user clicks a report document in the Web Document Viewer.

The handler function receives two parameters - the first parameter is the client-side Document Viewer (the event sender) and the second parameter is an object with the following properties and methods:

  • PageIndex
    A zero-based index of the clicked page.

  • Brick
    A visual brick object that is related to the clicked report control.

  • Handled
    Specifies whether default event handling is required.

  • DefaultHandler
    A function that runs when the Handled field is set to false (the default value). You can call this function within your event handler and set the Handled field to true to prevent the function from being called twice.

  • GetBrickText
    Returns the text displayed in the clicked element (report brick).

  • GetBrickValue
    Returns additional information on the brick.

For more information on report bricks, review the following help topic: Bricks.

The following code obtains the clicked element’s text:

window.ReportingViewerCustomization = {
    onPreviewClick: function(s, e) {
        e.Brick && alert(e.GetBrickText())
    }
}
See Also