WebDocumentViewerClientSideEventsBuilder.CustomizeElements(String) Method

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

Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer

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

Declaration

public WebDocumentViewerClientSideEventsBuilder CustomizeElements(
    string callback
)
Public Function CustomizeElements(
    callback As String
) As WebDocumentViewerClientSideEventsBuilder

Parameters

Type Name Description
String callback

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

Returns

Type Description
WebDocumentViewerClientSideEventsBuilder

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

The CustomizeElements event enables you to customize the Web Document Viewer's UI elements. 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.

  • Elements
    A collection of the UI elements included in the Web Document Viewer.

  • GetById
    This method allows you to obtain the required element by its ID using the DevExpress.Report.Preview.PreviewElements object. The following elements are available within this object:

    • RightPanel - corresponds to the panel at the right of the Viewer and containing tabs with the Document Map, Parameters and Export Options.
    • Surface - corresponds to the Viewer's central section displaying the report document.
    • Toolbar - corresponds to the Document Viewer's Toolbar.

The code sample below demonstrates how to use this event to hide the Web Document Viewer's Toolbar.

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

See Also