|
1 | 1 | <!-- default badges list --> |
2 | | - |
3 | 2 | [](https://supportcenter.devexpress.com/ticket/details/T1002174) |
4 | 3 | [](https://docs.devexpress.com/GeneralInformation/403183) |
5 | 4 | <!-- default badges end --> |
6 | 5 |
|
7 | 6 | # Dashboard for MVC - How to access API of underlying widgets |
8 | | -<!-- run online --> |
9 | | -**[[Run Online]](https://codecentral.devexpress.com/371736934/)** |
10 | | -<!-- run online end --> |
11 | 7 |
|
12 | | -The following example shows how to customize options of underlying widgets in ASP.NET MVC. For this, you need to handle the [onItemWidgetOptionsPrepared](https://docs.devexpress.com/Dashboard/js-DevExpress.Dashboard.ViewerApiExtensionOptions?p=netframework#js_devexpress_dashboard_viewerapiextensionoptions_onitemwidgetoptionsprepared) event. |
| 8 | +The following example shows how to customize options of underlying widgets in ASP.NET MVC. |
13 | 9 |
|
| 10 | +Use the [ViewerApiExtension.on](https://docs.devexpress.com/Dashboard/js-DevExpress.Dashboard.ViewerApiExtension#js_devexpress_dashboard_viewerapiextension_on) and [ViewerApiExtension.off](https://docs.devexpress.com/Dashboard/js-DevExpress.Dashboard.ViewerApiExtension#js_devexpress_dashboard_viewerapiextension_off) methods to subscribe and unsubscribe from the events. |
| 11 | + |
| 12 | +The Web Dashboard renders an underlying widget as follows: |
| 13 | + |
| 14 | +1. The Web Dashboard loads the widget’s default configuration. |
| 15 | + |
| 16 | + The [onItemWidgetOptionsPrepared](https://docs.devexpress.com/Dashboard/js-DevExpress.Dashboard.ViewerApiExtensionOptions#js_devexpress_dashboard_viewerapiextensionoptions_onitemwidgetoptionsprepared) event is raised. Handle this event to customize the DevExtreme widget’s options before the widget is rendered. |
| 17 | + |
| 18 | +1. The Web Dashboard renders the UI component with the configured options. |
| 19 | + |
| 20 | + The [onItemWidgetCreated](https://docs.devexpress.com/Dashboard/js-DevExpress.Dashboard.ViewerApiExtensionOptions#js_devexpress_dashboard_viewerapiextensionoptions_onitemwidgetcreated) event is raised. It occurs once for each UI component when the dashboard is loaded to the client. You can use this event to customize the UI component instance. |
| 21 | + |
| 22 | +1. The UI component is updated (for example, when you apply filters or change parameter values). |
| 23 | + |
| 24 | + The [onItemWidgetUpdated](https://docs.devexpress.com/Dashboard/js-DevExpress.Dashboard.ViewerApiExtensionOptions#js_devexpress_dashboard_viewerapiextensionoptions_onitemwidgetupdated) event is raised. It occurs every time the UI component should be re-rendered. |
| 25 | + |
14 | 26 | The customized options are listed below: |
15 | 27 |
|
16 | 28 | - The hovered grid row is highlighted in the underlying [dxDataGrid](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxDataGrid/). |
17 | 29 | - A standard tooltip that appears when a user hovers over a chart's series point is disabled. |
18 | 30 | - A custom tooltip appears when a user clicks a label on the chart's argument axis. The [onArgumentAxisClick](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxChart/Configuration/#onArgumentAxisClick) property executes a function that invokes the custom tooltip. |
19 | | -- The [animation](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxChart/Configuration/animation/) is enabled for the [dxChart](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxChart/) and [dxPieChart](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxPieChart/) widgets. |
20 | | -- The [dxPieChart](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxPieChart/) widget displays a legend. |
| 31 | +- The [animation](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxChart/Configuration/animation/) is enabled for the [dxChart](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxChart/) and [dxPieChart](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxPieChart/) UI components. |
| 32 | +- The [dxPieChart](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxPieChart/) UI component displays a legend. |
| 33 | +- The font weight and an interval between major ticks are modified in the [dxCircularGauge](https://js.devexpress.com/DevExtreme/ApiReference/UI_Components/dxCircularGauge/) UI component. |
21 | 34 |
|
22 | 35 | ## Files to Review |
23 | 36 |
|
|
0 commit comments