dashboard-js-devexpress-dot-dashboard-3013074e.md
A Card underlying widget that visualizes a Card dashboard item’s data.
export interface CardWidget
The following code snippet shows how to customize specific text displayed within the Card dashboard item using the onCustomizeText handler. You can use this code inside the onItemWidgetCreated handler.
"viewerApi": {
onItemWidgetCreated: function (e) {
if (e.itemName == "cardDashboardItem1") {
var card = e.getWidget();
card.onCustomizeText = function(args) {
if (args.getValue() == "UK") {
return "United Kingdom";
}
if (args.getValue() == "USA") {
return "United States";
}
};
}
}
}
Specifies the background color for a card.
cardBackColor: string
| Type | Description |
|---|---|
| string |
A string that specifies the HTML color used to paint a card’s background.
|
Gets the root element of the widget.
element: () => DevExpress.Dashboard.DxElement
| Type |
|---|
| () => DxElement |
A handler for the event allowing you to customize text displayed within individual cards.
onCustomizeText: (args: {
getValue: () => any;
getDefaultText: () => string;
}) => string
| Type | Description |
|---|---|
| (args: {getDefaultText: () => string, getValue: () => any}) => string |
A function used to customize texts displayed within individual cards.
|
The following code snippet shows how to customize specific text displayed within the Card dashboard item using the onCustomizeText handler. You can use this code inside the onItemWidgetUpdated / onItemWidgetCreated handlers.
"viewerApi": {
onItemWidgetUpdated: function (e) {
if (e.itemName == "cardDashboardItem1") {
var card = e.getWidget();
card.onCustomizeText = function(args) {
if (args.getValue() == "UK") {
return "United Kingdom";
}
if (args.getValue() == "USA") {
return "United States";
}
};
}
}
}