|
3 | 3 | var control = sender.GetDashboardControl();
|
4 | 4 | control.registerExtension(new DevExpress.Dashboard.DashboardPanelExtension(control, { dashboardThumbnail: "./Content/DashboardThumbnail/{0}.png" }));
|
5 | 5 | }
|
6 |
| - function onClick() { |
7 |
| - WebDashboard1.GetDashboardControl().reloadData(); |
8 |
| - } |
9 |
| - function myfunction() { |
| 6 | + function reloadOnServer() { |
10 | 7 | $.ajax({
|
11 | 8 | url: '@Url.Action("Refresh")',
|
12 | 9 | success: function (data) {
|
|
15 | 12 | // WebDashboard1.GetDashboardControl().refresh( ["chartDashboardItem1", "listBoxDashboardItem1"] );
|
16 | 13 | }
|
17 | 14 | })
|
18 |
| - } |
| 15 | + } |
| 16 | + function reloadOnClient() { |
| 17 | + WebDashboard1.GetDashboardControl().reloadData(); |
| 18 | + } |
19 | 19 | </script>
|
20 | 20 |
|
21 | 21 | <div style="position: absolute; top: 5px; left: 5px">
|
22 | 22 | @Html.DevExpress().Button(settings => {
|
23 | 23 | settings.Name = "ButtonServer";
|
24 | 24 | settings.Text = "Reset Cache (Server)";
|
25 | 25 | settings.UseSubmitBehavior = false;
|
26 |
| - settings.ClientSideEvents.Click = "myfunction"; |
| 26 | + settings.ClientSideEvents.Click = "reloadOnServer"; |
27 | 27 | }).GetHtml()
|
28 | 28 | </div>
|
29 | 29 | <div style="position: absolute; top: 5px; left: 192px">
|
30 | 30 | @Html.DevExpress().Button(settings => {
|
31 | 31 | settings.Name = "ButtonClient";
|
32 | 32 | settings.UseSubmitBehavior = false;
|
33 | 33 | settings.Text = "Reset Cache (Client)";
|
34 |
| - settings.ClientSideEvents.Click = "onClick"; |
| 34 | + settings.ClientSideEvents.Click = "reloadOnClient"; |
35 | 35 | }).GetHtml()
|
36 | 36 | </div>
|
37 | 37 | <div style="position: absolute; left: 0; top: 43px; right: 0; bottom: 0; border-top: 1px solid #cfcfcf">
|
|
0 commit comments