Skip to content

Commit 3ff40d8

Browse files
Update item IDs
1 parent f3f9077 commit 3ff40d8

File tree

13 files changed

+293
-123
lines changed

13 files changed

+293
-123
lines changed

CS/AspNetCoreCustomItem/Data/Dashboards/countryInfo.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</ExcelDataSource>
1212
</DataSources>
1313
<Items>
14-
<CustomItem ComponentName="customItemDashboardItem1" Name="Online Map" DataSource="excelDataSource1" CustomItemType="onlineMapItem">
14+
<CustomItem ComponentName="customItemDashboardItem1" Name="Online Map" DataSource="excelDataSource1" CustomItemType="OnlineMap">
1515
<CustomProperties>
1616
<Type>RoadMap</Type>
1717
</CustomProperties>
@@ -37,7 +37,7 @@
3737
<Longitude ItemType="Dimension" DefaultId="DataItem1" />
3838
</CustomMetadata>
3939
</CustomItem>
40-
<CustomItem ComponentName="customItemDashboardItem2" Name="Web Page" DataSource="excelDataSource1" CustomItemType="webPageItem">
40+
<CustomItem ComponentName="customItemDashboardItem2" Name="Web Page" DataSource="excelDataSource1" CustomItemType="WebPage">
4141
<DataItems>
4242
<Dimension DataMember="Country" DefaultId="DataItem0" />
4343
</DataItems>

CS/AspNetCoreCustomItem/Data/Dashboards/countrySales.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</Parameter>
3636
</Parameters>
3737
<Items>
38-
<CustomItem ComponentName="customItemDashboardItem2" Name="Polar Chart" DataSource="DataSource1" DataMember="SalesPerson" CustomItemType="polarChartItem">
38+
<CustomItem ComponentName="customItemDashboardItem2" Name="Polar Chart" DataSource="DataSource1" DataMember="SalesPerson" CustomItemType="PolarChart">
3939
<InteractivityOptions MasterFilterMode="Single" />
4040
<DataItems>
4141
<Measure DataMember="ExtendedPrice" SummaryType="Count" DefaultId="DataItem0" />
@@ -64,7 +64,7 @@
6464
<dimensionValue ItemType="Dimension" DefaultId="DataItem1" />
6565
</CustomMetadata>
6666
</CustomItem>
67-
<CustomItem ComponentName="customItemDashboardItem3" Name="Simple Table" DataSource="DataSource1" DataMember="SalesPerson" CustomItemType="simpleTableItem">
67+
<CustomItem ComponentName="customItemDashboardItem3" Name="Simple Table" DataSource="DataSource1" DataMember="SalesPerson" CustomItemType="CustomItemSimpleTable">
6868
<CustomProperties>
6969
<showHeaders>On</showHeaders>
7070
</CustomProperties>
@@ -91,7 +91,7 @@
9191
<customMeasure ItemType="Measure" DefaultId="DataItem1" />
9292
</CustomMetadata>
9393
</CustomItem>
94-
<CustomItem ComponentName="customItemDashboardItem1" Name="Parameters" ShowCaption="false" DataSource="DataSource1" DataMember="SalesPerson" CustomItemType="parameterItem">
94+
<CustomItem ComponentName="customItemDashboardItem1" Name="Parameters" ShowCaption="false" DataSource="DataSource1" DataMember="SalesPerson" CustomItemType="ParameterItem">
9595
<CustomProperties>
9696
<automaticUpdates>On</automaticUpdates>
9797
</CustomProperties>

CS/AspNetCoreCustomItem/Data/Dashboards/departments.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</GridColumns>
4848
<GridOptions />
4949
</Grid>
50-
<CustomItem ComponentName="customItemDashboardItem1" Name="Hierarchical Tree View" DataSource="dashboardSqlDataSource1" DataMember="Table" CustomItemType="hierarchicalTreeViewItem">
50+
<CustomItem ComponentName="customItemDashboardItem1" Name="Hierarchical Tree View" DataSource="dashboardSqlDataSource1" DataMember="Table" CustomItemType="TreeView">
5151
<InteractivityOptions IgnoreMasterFilters="true" MasterFilterMode="Multiple" />
5252
<DataItems>
5353
<Dimension DataMember="ID" DefaultId="DataItem0" />

CS/AspNetCoreCustomItem/Data/Dashboards/tasks.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</ObjectDataSource>
88
</DataSources>
99
<Items>
10-
<CustomItem ComponentName="customItemDashboardItem1" Name="Gantt Chart" DataSource="objectDataSource1" CustomItemType="ganttItem">
10+
<CustomItem ComponentName="customItemDashboardItem1" Name="Gantt Chart" DataSource="objectDataSource1" CustomItemType="GanttItem">
1111
<InteractivityOptions MasterFilterMode="Single" />
1212
<DataItems>
1313
<Dimension DataMember="UID" DefaultId="DataItem0" />

CS/AspNetCoreCustomItem/wwwroot/css/site.min.css

Lines changed: 228 additions & 72 deletions
Large diffs are not rendered by default.

CS/AspNetCoreCustomItem/wwwroot/js/GanttItem.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
let GanttCustomItem = (function () {
22
const Dashboard = DevExpress.Dashboard;
33

4-
const svgIcon = `<? xml version = "1.0" encoding = "utf-8"?>
5-
<svg version="1.1" id="ganttItemIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
4+
const GANTT_EXTENSION_NAME = 'GanttItem';
5+
6+
const svgIcon = `<?xml version = "1.0" encoding = "utf-8"?>
7+
<svg version="1.1" id="`+ GANTT_EXTENSION_NAME + `" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
68
<path class="dx-dashboard-contrast-icon" d="M23,2c0-0.6-0.4-1-1-1H2C1.4,1,1,1.4,1,2v20c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1 V2z M21,21H3V3h18V21z"/>
79
<path class="dx-dashboard-accent-icon" d="M12,9H5V5h7V9z M19,10H9v4h10V10z M15,15H7v4h8V15z"/>
810
</svg>`;
@@ -37,7 +39,7 @@
3739
interactivity: {
3840
filter: true
3941
},
40-
icon: 'ganttItemIcon',
42+
icon: GANTT_EXTENSION_NAME,
4143
title: 'Gantt Chart',
4244
index: 0
4345
};
@@ -143,8 +145,8 @@
143145
};
144146

145147
function GanttItem(dashboardControl) {
146-
Dashboard.ResourceManager.registerIcon(svgIcon);
147-
this.name = "ganttItem";
148+
dashboardControl.registerIcon(svgIcon);
149+
this.name = GANTT_EXTENSION_NAME;
148150
this.metaData = ganttItemMetadata;
149151
this.createViewerItem = function (model, $element, content) {
150152
return new GanttItemViewer(model, $element, content);

CS/AspNetCoreCustomItem/wwwroot/js/HierarchicalTreeViewItem.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
let TreeViewCustomItem = (function () {
22
const Dashboard = DevExpress.Dashboard;
33
const dxTreeView = DevExpress.ui.dxTreeView;
4+
5+
const HIERARCIAL_TREE_VIEW_EXTENSION_NAME = 'TreeView';
6+
47
const svgIcon = `<?xml version="1.0" encoding="utf-8"?>
5-
<svg version="1.1" id="treeViewIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
8+
<svg version="1.1" id="` + HIERARCIAL_TREE_VIEW_EXTENSION_NAME +`" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
69
<polygon class="dx-dashboard-contrast-icon" points="12,13 12,11 8,11 8,8 6,8 6,21 12,21 12,19 8,19 8,13 "/>
710
<path class="dx-dashboard-accent-icon" d="M10,7H4C3.5,7,3,6.6,3,6V2c0-0.5,0.5-1,1-1h6c0.6,0,1,0.5,1,1v4C11,6.6,10.6,7,10,7z
811
M21,14v-4c0-0.6-0.5-1-1-1h-6c-0.6,0-1,0.4-1,1v4c0,0.6,0.4,1,1,1h6C20.5,15,21,14.6,21,14z M21,22v-4c0-0.5-0.5-1-1-1h-6
@@ -36,7 +39,7 @@
3639
filter: true,
3740
applyEmptyFilter: true
3841
},
39-
icon: 'treeViewIcon',
42+
icon: HIERARCIAL_TREE_VIEW_EXTENSION_NAME,
4043
// Uncomment the line below to place this custom item in the "Filter" group:
4144
//groupName: 'filter',
4245
title: 'Hierarchical Tree View',
@@ -105,8 +108,8 @@
105108
};
106109

107110
function TreeViewItem(dashboardControl) {
108-
DevExpress.Dashboard.ResourceManager.registerIcon(svgIcon);
109-
this.name = "hierarchicalTreeViewItem";
111+
dashboardControl.registerIcon(svgIcon);
112+
this.name = HIERARCIAL_TREE_VIEW_EXTENSION_NAME;
110113
this.metaData = treeViewMetadata;
111114
this.createViewerItem = function (model, $element, content) {
112115
return new TreeViewViewer(model, $element, content, dashboardControl);

CS/AspNetCoreCustomItem/wwwroot/js/OnlineMapItem.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
const Designer = DevExpress.Dashboard.Designer;
55
const dxMap = DevExpress.ui.dxMap;
66

7+
const ONLINE_MAP_EXTENSION_NAME = 'OnlineMap';
8+
79
const svgIcon = `<?xml version="1.0" encoding="utf-8"?>
8-
<svg version="1.1" id="onlineMapItemIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
10+
<svg version="1.1" id="` + ONLINE_MAP_EXTENSION_NAME + `" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
911
<path class="dx-dashboard-contrast-icon" d="M12,1C8.1,1,5,4.1,5,8c0,3.9,3,10,7,15c4-5,7-11.1,7-15C19,4.1,15.9,1,12,1z M12,12c-2.2,0-4-1.8-4-4
1012
c0-2.2,1.8-4,4-4s4,1.8,4,4C16,10.2,14.2,12,12,12z"/>
1113
<circle class="dx-dashboard-accent-icon" cx="12" cy="8" r="2"/>
1214
</svg>`;
15+
1316
const onlineMapMetadata = {
1417
bindings: [{
1518
propertyName: 'Latitude',
@@ -86,7 +89,7 @@
8689
filter: true,
8790
drillDown: false
8891
},
89-
icon: 'onlineMapItemIcon',
92+
icon: ONLINE_MAP_EXTENSION_NAME,
9093
title: 'Online Map',
9194
index: 1
9295
};
@@ -184,10 +187,9 @@
184187
}
185188
};
186189

187-
188190
function OnlineMapItem(dashboardControl) {
189-
Dashboard.ResourceManager.registerIcon(svgIcon);
190-
this.name = "onlineMapItem";
191+
dashboardControl.registerIcon(svgIcon);
192+
this.name = ONLINE_MAP_EXTENSION_NAME;
191193
this.metaData = onlineMapMetadata;
192194
this.createViewerItem = function (model, $element, content) {
193195
return new OnlineMapItemViewer(model, $element, content);

CS/AspNetCoreCustomItem/wwwroot/js/ParameterItem.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
const Model = DevExpress.Dashboard.Model;
33
const Designer = DevExpress.Dashboard.Designer;
44

5+
const PARAMETER_EXTENSION_NAME = 'ParameterItem';
6+
57
const onOffButtons = [{ text: 'On' }, { text: 'Off' }];
68
const buttonsStyle = {
79
containerHeight: 60,
@@ -12,7 +14,7 @@
1214
};
1315

1416
const svgIcon = `<?xml version="1.0" encoding="utf-8"?>
15-
<svg version="1.1" id="parameterItemIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
17+
<svg version="1.1" id="` + PARAMETER_EXTENSION_NAME + `" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
1618
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
1719
<g class="st0">
1820
<path class="dx-dashboard-contrast-icon" d="M6,12c0.4,0,0.7,0.1,1,0.2V5c0-0.6-0.4-1-1-1S5,4.4,5,5v7.2
@@ -66,7 +68,7 @@
6668
},
6769
}],
6870
}],
69-
icon: 'parameterItemIcon',
71+
icon: PARAMETER_EXTENSION_NAME,
7072
title: 'Parameters',
7173
};
7274

@@ -89,7 +91,6 @@
8991
ParameterItemViewer.prototype = Object.create(DevExpress.Dashboard.CustomItemViewer.prototype);
9092
ParameterItemViewer.prototype.constructor = ParameterItemViewer;
9193

92-
9394
ParameterItemViewer.prototype.setSize = function (width, height) {
9495
Object.getPrototypeOf(ParameterItemViewer.prototype).setSize.call(this, width, height);
9596
this._setGridHeight();
@@ -103,7 +104,6 @@
103104
this.buttons.forEach(button => button.dispose());
104105
}
105106

106-
107107
ParameterItemViewer.prototype.renderContent = function ($element, changeExisting) {
108108
var element = $element.get(0);
109109
if (!changeExisting) {
@@ -200,8 +200,8 @@
200200
};
201201

202202
function ParameterItem(dashboardControl) {
203-
DevExpress.Dashboard.ResourceManager.registerIcon(svgIcon);
204-
this.name = "parameterItem";
203+
dashboardControl.registerIcon(svgIcon);
204+
this.name = PARAMETER_EXTENSION_NAME;
205205
this.metaData = parameterMetadata;
206206
this.createViewerItem = function (model, $element, content) {
207207
var parametersExtension = dashboardControl.findExtension("dashboard-parameter-dialog");

CS/AspNetCoreCustomItem/wwwroot/js/PolarChartItem.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
const CustomItemViewer = DevExpress.Dashboard.CustomItemViewer;
44
const dxPolarChart = DevExpress.viz.dxPolarChart;
55

6+
const POLAR_CHART_EXTENSION_NAME = 'PolarChart';
7+
68
const svgIcon = `<?xml version="1.0" encoding="utf-8"?>
7-
<svg version="1.1" id="polarChartItemIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
9+
<svg version="1.1" id="` + POLAR_CHART_EXTENSION_NAME + `" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
810
<path class="dx-dashboard-contrast-icon" d="M12,1C5.9,1,1,5.9,1,12s4.9,11,11,11s11-4.9,11-11S18.1,1,12,1z M12,21c-5,0-9-4-9-9s4-9,9-9s9,4,9,9S17,21,12,21z" />
911
<path class="dx-dashboard-accent-icon" d="M17,10c-0.6,0-1.1,0.2-1.5,0.4L13.8,9C13.9,8.7,14,8.4,14,8c0-1.7-1.3-3-3-3S8,6.3,8,8c0,1,0.5,2,1.3,2.5L8.7,13C7.2,13.2,6,14.4,6,16c0,1.7,1.3,3,3,3s3-1.3,3-3c0,0,0,0,0-0.1l2.7-1c0.6,0.7,1.4,1.1,2.3,1.1c1.7,0,3-1.3,3-3S18.7,10,17,10z M9,17c-0.6,0-1-0.4-1-1s0.4-1,1-1s1,0.4,1,1S9.6,17,9,17z M10,8c0-0.6,0.4-1,1-1s1,0.4,1,1s-0.4,1-1,1S10,8.6,10,8zM14,13.1l-2.7,1c-0.2-0.2-0.4-0.4-0.6-0.6l0.6-2.5c0.4,0,0.9-0.2,1.2-0.4l1.7,1.4C14.1,12.3,14,12.6,14,13.1C14,13,14,13,14,13.1zM17,14c-0.6,0-1-0.4-1-1s0.4-1,1-1s1,0.4,1,1S17.6,14,17,14z" />
1012
</svg > `;
@@ -44,7 +46,7 @@
4446
}
4547
}]
4648
}],
47-
icon: 'polarChartItemIcon',
49+
icon: POLAR_CHART_EXTENSION_NAME,
4850
title: 'Polar Chart',
4951
index: 2
5052
};
@@ -157,8 +159,8 @@
157159
};
158160

159161
function PolarChartItem(dashboardControl) {
160-
DevExpress.Dashboard.ResourceManager.registerIcon(svgIcon);
161-
this.name = "polarChartItem";
162+
dashboardControl.registerIcon(svgIcon);
163+
this.name = POLAR_CHART_EXTENSION_NAME;
162164
this.metaData = polarChartItemMetadata;
163165
this.createViewerItem = function (model, $element, content) {
164166
return new PolarChartItemViewer(model, $element, content);

CS/AspNetCoreCustomItem/wwwroot/js/SimpleTableItem.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
const CustomItem = DevExpress.Dashboard.Model.CustomItem;
33
const FormItemTemplates = DevExpress.Dashboard.Designer.FormItemTemplates;
44

5+
const SIMPLE_TABLE_EXTENSION_NAME = 'CustomItemSimpleTable';
6+
57
const svgIcon = `<?xml version="1.0" encoding="utf-8"?>
6-
<svg version="1.1" id="simpleTableIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
8+
<svg version="1.1" id="` + SIMPLE_TABLE_EXTENSION_NAME + `" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
79
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
810
<path class="dx-dashboard-contrast-icon" d="M21,2H3C2.5,2,2,2.5,2,3v18c0,0.5,0.5,1,1,1h18c0.5,0,1-0.5,1-1V3
911
C22,2.5,21.5,2,21,2z M14,4v4h-4V4H14z M10,10h4v4h-4V10z M4,4h4v4H4V4z M4,10h4v4H4V10z M4,20v-4h4v4H4z M10,20v-4h4v4H10z M20,20
@@ -49,7 +51,7 @@
4951
}
5052
}]
5153
}],
52-
icon: 'simpleTableIcon',
54+
icon: SIMPLE_TABLE_EXTENSION_NAME,
5355
title: 'Simple Table'
5456
};
5557

@@ -112,8 +114,8 @@
112114
};
113115

114116
function SimpleTableItem(dashboardControl) {
115-
DevExpress.Dashboard.ResourceManager.registerIcon(svgIcon);
116-
this.name = "simpleTableItem";
117+
dashboardControl.registerIcon(svgIcon);
118+
this.name = SIMPLE_TABLE_EXTENSION_NAME;
117119
this.metaData = simpleTableMetadata;
118120
this.createViewerItem = function (model, $element, content) {
119121
return new SimpleTableItemViewer(model, $element, content);

CS/AspNetCoreCustomItem/wwwroot/js/WebPageItem.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
let WebPageCustomItem = (function () {
2+
3+
const WEBPAGE_EXTENSION_NAME = 'WebPage';
4+
25
const svgIcon = `<?xml version="1.0" encoding="utf-8"?>
3-
<svg version = "1.1" id = "webPageItemIcon" xmlns = "http://www.w3.org/2000/svg" xmlns: xlink = "http://www.w3.org/1999/xlink" x = "0px" y = "0px" viewBox = "0 0 24 24" style = "enable-background:new 0 0 24 24;" xml: space = "preserve" >
6+
<svg version="1.1" id="` + WEBPAGE_EXTENSION_NAME + `" xmlns = "http://www.w3.org/2000/svg" xmlns:xlink = "http://www.w3.org/1999/xlink" x = "0px" y = "0px" viewBox = "0 0 24 24" style = "enable-background:new 0 0 24 24;" xml:space = "preserve" >
47
<path class="dx-dashboard-contrast-icon" d="M20.7,4.7l-3.4-3.4C17.1,1.1,16.9,1,16.6,1H4C3.4,1,3,1.4,3,2v20c0,0.6,0.4,1,1,1h16
58
c0.6,0,1-0.4,1-1V5.4C21,5.1,20.9,4.9,20.7,4.7z M19,21H5V3h11v2c0,0.6,0.4,1,1,1h2V21z"/>
69
<path class="dx-dashboard-accent-icon" d="M13.7,17.5c-0.2-0.4-1.6-1.8-1.4-2.2s0.2-1.1-0.1-1.3c-0.3-0.1-0.7,0.1-0.7-0.2
@@ -32,7 +35,7 @@
3235
editorType: 'dxTextBox',
3336
}]
3437
}],
35-
icon: 'webPageItemIcon',
38+
icon: WEBPAGE_EXTENSION_NAME,
3639
title: 'Web Page',
3740
index: 2
3841
};
@@ -67,8 +70,8 @@
6770
};
6871

6972
function WebPageItem(dashboardControl) {
70-
DevExpress.Dashboard.ResourceManager.registerIcon(svgIcon);
71-
this.name = "webPageItem";
73+
dashboardControl.registerIcon(svgIcon);
74+
this.name = WEBPAGE_EXTENSION_NAME;
7275
this.metaData = webPageMetadata;
7376
this.createViewerItem = function (model, $element, content) {
7477
return new WebPageItemViewer(model, $element, content);

CS/AspNetCoreCustomItem/wwwroot/js/site.min.js

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)