xtrareports-404134-web-reporting-blazor-reporting-web-document-viewer-customization-client-side-events.md
The Blazor Document Viewer is based on the DevExpress Web Document Viewer. The Web Document Viewer includes an advanced client-side API that allows you to customize UI elements and behavior. The DxDocumentViewerCallbacks component exposes properties that allow you to specify JavaScript functions (client-side event handlers).
Follow these steps to customize the Blazor Document Viewer using its client-side API:
Place your JavaScript code in a separate file in the wwwroot folder. Use the window object to create a namespace for your code.
Use the DxResourceManager.RegisterScripts() method to register the corresponding script:
Specify JavaScript function names as event handlers for the DxDocumentViewerCallbacks component:
Document Viewer Client-Side events allow you to perform the following actions:
| Event | Description |
|---|---|
| CustomizeElements | Allows you to customize the Web Document Viewer’s UI elements (Parameter Panel, Right Panel, Toolbar). |
| CustomizeMenuActions | Enables you to customize the Web Document Viewer’s toolbar. |
| CustomizeExportOptions | Allows you to customize the Web Document Viewer’s available export formats and corresponding export options. |
| Event | Description |
|---|---|
| CustomizeParameterEditors | Enables you to provide custom editors for report parameters. |
| CustomizeParameterLookUpSource | Allows you to customize look-up report parameter values. |
| Event | Description |
|---|---|
| ParametersInitialized | Allows you to get the client-side parameter values when they are initialized and modify them. |
| Event | Description |
|---|---|
| ParametersReset | Occurs after report parameter values are reset to their default values. |
| ParametersSubmitted | Occurs after report parameter values are submitted. |
| Event | Description |
|---|---|
| DocumentReady | Occurs after the Web Document Viewer loads a report document. |
| Event | Description |
|---|---|
| PreviewClick | Occurs when a report document is clicked. |
| EditingFieldChanged | Occurs each time an edit field’s value changes. |
| Event | Description |
|---|---|
| CustomizeLocalization | Enables you to replace the Web Document Viewer’s localization strings with custom strings. |
| Event | Description |
|---|---|
| OnServerError | Occurs on the client each time a server-side error is raised. |
| Event | Description |
|---|---|
| BeforeRender | Occurs before the Web Document Viewer UI is initialized. |
| OnInitializing | Occurs before the View Model is fetched from the server, and before the BeforeRender event. |
See Also