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

WebDocumentViewerClientSideEventsBuilder.PreviewClick(String) Method

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

Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer

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

NuGet Package: DevExpress.AspNetCore.Reporting

Declaration

public WebDocumentViewerClientSideEventsBuilder PreviewClick(
    string callback
)

Parameters

Name Type Description
callback String

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

Returns

Type Description
WebDocumentViewerClientSideEventsBuilder

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

Remarks

The PreviewClick event enables performing different actions when an end-user clicks the report document in the Web Document Viewer. 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.

  • PageIndex
    A value specifying the zero-based index of the page that has been clicked.

  • Brick
    Provides information on a visual brick representing content of a report control that has been clicked.

  • Handled
    Specifies whether or not the event was handled and no default processing is required.

  • DefaultHandler
    A function that is performed if the Handled field is set to false (the default value). You can call this function within your event handler if required, and set the Handled field to true.

  • GetBrickText
    Returns the text displayed by the report element that has been clicked.

  • GetBrickValue
    Returns additional information on the brick.

The code sample below demonstrates how to obtain the text of an element that has been clicked.

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