dashboard-js-devexpress-dot-dashboard-395a6027.md
A class containing methods used to manage dashboard control static content.
export class ResourceManager
Obsolete. This method has no effect in v24.2 and later.
static embedBundledResources(): void
Warning
The ResourceManager.embedBundledResources() method became obsolete in v24.2. Remove the method call from your application. For more information, refer to the following breaking change document: Web Dashboard - The approach for storing SVG and HTML templates has changed.
Embeds an icon’s SVG definition onto the page.
static registerIcon(
icon: string | HTMLElement,
id?: string
): void
| Name | Type | Description |
|---|---|---|
| icon | string | HTMLElement |
A string or HTML object that stores the icon’s definition.
| | id | string |
(Optional) The icon’s id.
|
Use the registerIcon method as an alternative variant to add an icon to the page. Make sure the following requirements are met:
id attribute. If there is no id attribute in the icon’s definition, pass the icon’s id as the second parameter to the registerIcon method.In your JavaScript code, declare a string variable and specify the icon’s definition.
var customItemIcon = '<svg id="customIconId" viewBox="0 0 24 24"><style type="text/css">.dx-dashboard-icon {fill:currentColor;}</style><path class="dx-dashboard-icon" d="M12 2 L2 22 L22 22 Z" /></svg>';
After that, pass the created variable as the registerIcon method’s parameter.
if(!!dashboardControl) {
dashboardControl.registerIcon(customItemIcon);
}
Tip
See Predefined Colors for information on which color constants you can use to natively embed an icon in the Web Dashboard application.
Obsolete. This method has no effect in v24.2 and later.
static removeEmbeddedResources(): void
Warning
The ResourceManager.removeEmbeddedResources() method became obsolete in v24.2. Remove this method call from your application. For more information, refer to the following breaking change document: Web Dashboard - The approach for storing SVG and HTML templates has changed.
Allows you to define dashboard localization strings.
static setLocalizationMessages(localizationMessages: {
[localizationStringId: string]: string;
}): void
| Name | Type | Description |
|---|---|---|
| localizationMessages | {[localizationStringId: string]: string} |
An object in a {string : string} format, where the first string is a localization string id, and the second string is a localization message.
|
The code snippet below shows how to change a localization message used in the Export To button’s tooltip.
<head>
<!-- ...-->
<script>
DevExpress.Dashboard.ResourceManager.setLocalizationMessages({ "DashboardStringId.ActionExportTo": "Custom Text for Export Button" });
window.onload = function () {
var dashboardControl = new DevExpress.Dashboard.DashboardControl(document.getElementById("web-dashboard"), {
endpoint: "https://demos.devexpress.com/services/dashboard/api"
});
dashboardControl.render();
};
</script>
</head>