xtrareports-devexpress-dot-aspnetcore-dot-reporting-dot-webdocumentviewer-dot-webdocumentviewerclientsideeventsbuilder-dot-customizeelements-x28-system-dot-string-x29.md
Specifies the JavaScript function that handles the client-side CustomizeElements event.
Namespace : DevExpress.AspNetCore.Reporting.WebDocumentViewer
Assembly : DevExpress.AspNetCore.Reporting.v25.2.dll
NuGet Package : DevExpress.AspNetCore.Reporting
public WebDocumentViewerClientSideEventsBuilder CustomizeElements(
string callback
)
Public Function CustomizeElements(
callback As String
) As WebDocumentViewerClientSideEventsBuilder
| Name | Type | Description |
|---|---|---|
| callback | String |
The name of a JavaScript function or entire JavaScript function code that runs when the CustomizeElements event occurs.
|
| Type | Description |
|---|---|
| WebDocumentViewerClientSideEventsBuilder |
WebDocumentViewerClientSideEventsBuilder that can be used for method chaining.
|
The CustomizeElements event allows you to customize the Web Document Viewer’s UI elements.
The handler function receives two parameters. The first parameter is the object that exposes the IPreviewModel interface (or the JSReportViewer object). The second parameter contains the following properties and methods:
The code sample below demonstrates how to use this event to hide the Web Document Viewer’s Toolbar.
<script type="text/javascript" id="script">
function customizeElements(s, e) {
var toolbarPart = e.GetById(
DevExpress.Reporting.Viewer.PreviewElements.Toolbar);
var index = e.Elements.indexOf(toolbarPart);
e.Elements.splice(index, 1);
}
</script>
@{
var documentViewer = Html.DevExpress().WebDocumentViewer("webDocumentViewer1")
.Height("1000px")
.Bind(Model.Report)
.ClientSideEvents(configure =>
{
configure.CustomizeElements("customizeElements");
});
}
@documentViewer
See Also
WebDocumentViewerClientSideEventsBuilder Class