DashboardClientSideEvents.ItemWidgetCreated Property
Gets or sets the name of the JavaScript function or the entire code which will handle the client ASPxClientDashboardViewer.ItemWidgetCreated event.
Namespace: DevExpress.DashboardWeb
Assembly: DevExpress.Dashboard.v18.2.Web.WebForms.dll
Declaration
[DefaultValue("")]
[XtraSerializableProperty]
public string ItemWidgetCreated { get; set; }
Property Value
Type | Default | Description |
---|---|---|
String | String.Empty | A string that is either the name of a JavaScript function or the entire JavaScript function code used to handle an event. |
Example
This example demonstrates how to customize client widgets used to visualize data within dashboard items at runtime using ASPxClientDashboardViewer‘s API.
The following options are changed:
- Highlighting of the hovered grid row is enabled in the underlying dxDataGrid in the ASPxClientDashboardViewer.ItemWidgetCreated event handler.
- A standard tooltip that is invoked when an end-user hovers over a chart series point is disabled. You can invoke a tooltip by clicking the required label on the argument axis. The argumentAxisClick event is used for this purpose. Subscription and unsubscription to/from the argumentAxisClick event are performed in the ASPxClientDashboardViewer.ItemWidgetUpdated and ASPxClientDashboardViewer.ItemWidgetUpdating event handlers respectively.
- A pie legend is shown for the underlying dxPieChart.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-access-api-of-underlying-widgets-in-the-mvc-viewer-t197593.
- _DashboardViewerPartial.cshtml (C#)
- WidgetsCustomization.js (C#)
- HomeController.cs
- _DashboardViewerPartial.cshtml (VB.NET)
- HomeController.vb
- WidgetsCustomization.js (VB.NET)
@model DevExpress.DashboardWeb.Mvc.DashboardSourceModel
@Html.DevExpress().DashboardViewer(settings => {
settings.Name = "DashboardViewer";
settings.CallbackRouteValues = new { Controller = "Home", Action = "DashboardViewerPartial" };
settings.ExportRouteValues = new { Controller = "Home", Action = "DashboardViewerPartialExport" };
settings.ClientSideEvents.ItemWidgetCreated = "function(s, e) { customizeWidgets(e); }";
settings.ClientSideEvents.ItemWidgetUpdated = "function(s, e) { customizeWidgets(e); }";
settings.ClientSideEvents.ItemWidgetUpdating = "function(s, e) { unsubscribeFromEvents(e); }";
settings.Width = 1200;
}).BindToSource(Model).GetHtml()
See Also