Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WebDocumentViewerClientSideEventsBuilderBase<TBuilder, TEvents>.OnInitializing(String) Method

Allows you to specify a JavaScript function that runs before Document Viewer fetches the View model from the server and before the BeforeRender event.

Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer

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

NuGet Package: DevExpress.AspNetCore.Reporting

#Declaration

public TBuilder OnInitializing(
    string callback
)

#Parameters

Name Type Description
callback String

The name of a JavaScript function or entire JavaScript function code that runs when the OnInitializing event occurs.

#Returns

Type Description
TBuilder

The WebDocumentViewerClientSideEventsBuilderBase<TBuilder, TEvents> object that can be used for method chaining.

#Remarks

The OnInitializing event occurs when the client component is created, before the view model is fetched from the server, and before the BeforeRender event occurs.

You can handle the OnInitializng event` to patch the initial “get designer model” HTTP request:

javascript
onInitializing: function (s) {
    DevExpress.Analytics.Utils.fetchSetup.fetchSettings = { headers: { HEADER1: 'VALUE1' } };
    //DevExpress.Analytics.Utils.ajaxSetup.ajaxSettings = { headers: { HEADER1: 'VALUE1' } };
}
See Also