-
Notifications
You must be signed in to change notification settings - Fork 2
/
Index.cshtml
46 lines (45 loc) · 1.89 KB
/
Index.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<script type="text/javascript">
function onBeforeRender(sender) {
var control = sender.GetDashboardControl();
control.registerExtension(new DevExpress.Dashboard.DashboardPanelExtension(control, { dashboardThumbnail: "./Content/DashboardThumbnail/{0}.png" }));
}
function reloadOnServer() {
$.ajax({
url: '@Url.Action("Refresh")',
success: function (data) {
WebDashboard1.GetDashboardControl().refresh();
// To refresh specific dashboard items, pass their names as parameters:
// WebDashboard1.GetDashboardControl().refresh( ["chartDashboardItem1", "listBoxDashboardItem1"] );
}
})
}
function reloadOnClient() {
WebDashboard1.GetDashboardControl().reloadData();
}
</script>
<div style="position: absolute; top: 5px; left: 5px">
@Html.DevExpress().Button(settings => {
settings.Name = "ButtonServer";
settings.Text = "Reset Cache (Server)";
settings.UseSubmitBehavior = false;
settings.ClientSideEvents.Click = "reloadOnServer";
}).GetHtml()
</div>
<div style="position: absolute; top: 5px; left: 192px">
@Html.DevExpress().Button(settings => {
settings.Name = "ButtonClient";
settings.UseSubmitBehavior = false;
settings.Text = "Reset Cache (Client)";
settings.ClientSideEvents.Click = "reloadOnClient";
}).GetHtml()
</div>
<div style="position: absolute; left: 0; top: 43px; right: 0; bottom: 0; border-top: 1px solid #cfcfcf">
@Html.DevExpress().Dashboard(settings => {
settings.Name = "WebDashboard1";
settings.ControllerName = "DefaultDashboard";
settings.Width = Unit.Percentage(100);
settings.Height = Unit.Percentage(100);
settings.UseNeutralFilterMode = true;
settings.ClientSideEvents.BeforeRender = "onBeforeRender";
}).GetHtml()
</div>