|
1 | | -@using Telerik.Web.Mvc.UI |
2 | | -@using System.Data |
3 | | -@using BExIS.Modules.EMM.UI.Models; |
| 1 | +@using BExIS.Modules.EMM.UI.Models; |
4 | 2 |
|
5 | 3 | @model EventRegistrationResultModel |
6 | 4 |
|
| 5 | +@section scripts |
| 6 | +{ |
| 7 | + <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.css"> |
| 8 | + <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.js"></script> |
| 9 | +} |
| 10 | + |
7 | 11 | @section Information |
8 | 12 | { |
9 | 13 | With this interface you get all registration from all open and closed events. |
|
15 | 19 | { |
16 | 20 | if (Model.UserHasRights) |
17 | 21 | { |
18 | | - |
19 | | - @(Html.Telerik().Grid(Model.Results) |
20 | | - .Name("EventRegistrationResults") |
21 | | - .Sortable() |
22 | | - .ClientEvents(clientEvents => clientEvents |
23 | | - .OnDataBound("onDataBound")) |
24 | | - .Columns(columns => |
25 | | - { |
26 | | - foreach (DataColumn dc in Model.Results.Columns) |
27 | | - { |
28 | | - string title; |
29 | | - |
30 | | - if (dc.Caption == "") |
31 | | - { |
32 | | - title = dc.ColumnName; |
33 | | - } |
34 | | - else |
35 | | - { |
36 | | - title = dc.Caption; |
37 | | - } |
38 | | - |
39 | | - columns.Bound(dc.DataType, dc.ColumnName) |
40 | | - .Title(title).Width(dc.ColumnName.Length * 3); // forced fixed column width to enable horizontal scrolling |
41 | | - } |
42 | | - } |
43 | | - |
44 | | - ) |
45 | | - ) |
46 | | - |
47 | | - @Html.ActionLink("Export (csv)", "Export", "EventRegistrationResult", new { id = Model.EventId }, new { @class = "bx-button function" }) |
48 | | - <span class="bx-button function" id="" onclick="Delete(@Model.EventId)" title="Delete event">Delete</span> |
49 | | -} |
50 | | -else |
51 | | -{ |
52 | | - <p>You have no rights to this event.</p> |
53 | | -} |
| 22 | +<table id="regResults"> |
| 23 | + <thead> |
| 24 | + <tr> |
| 25 | + @for (int c = 0; c < Model.Results.Columns.Count; c++) |
| 26 | + { |
| 27 | + <th> |
| 28 | + @Model.Results.Columns[c].ColumnName |
| 29 | + </th> |
| 30 | + } |
| 31 | + </tr> |
| 32 | + </thead> |
| 33 | + <tbody> |
| 34 | + @for (int i = 0; i < Model.Results.Rows.Count; i++) |
| 35 | + { |
| 36 | + <tr> |
| 37 | + @for (int c = 0; c < Model.Results.Columns.Count; c++) |
| 38 | + { |
| 39 | + <td> |
| 40 | + @Model.Results.Rows[i][c].ToString() |
| 41 | + </td> |
| 42 | + |
| 43 | + } |
| 44 | + </tr> |
| 45 | + } |
| 46 | + |
| 47 | + </tbody> |
| 48 | +</table> |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + @Html.ActionLink("Export (csv)", "Export", "EventRegistrationResult", new { id = Model.EventId }, new { @class = "bx-button function" }) |
| 53 | + <span class="bx-button function" id="" onclick="Delete(@Model.EventId)" title="Delete event">Delete</span> |
| 54 | + } |
| 55 | + else |
| 56 | + { |
| 57 | + <p>You have no rights to this event.</p> |
| 58 | + } |
54 | 59 | } |
55 | 60 |
|
56 | 61 |
|
|
65 | 70 |
|
66 | 71 | <script type="text/javascript"> |
67 | 72 |
|
| 73 | + $(document).ready(function () { |
| 74 | + $('#regResults').DataTable(); |
| 75 | + }); |
| 76 | +
|
| 77 | +
|
68 | 78 | function onDataBound() { |
69 | 79 | addTooltips(); |
70 | 80 | } |
|
0 commit comments