forked from topnguyen/Elect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_DataTableHtml.cshtml
48 lines (47 loc) · 1.26 KB
/
_DataTableHtml.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
47
48
@model Elect.Web.DataTable.Models.DataTableModel
@{
// Handle Default Values for Options
Model.IsShowFooter = Model.IsShowFooter ?? false;
Model.IsHideHeader = Model.IsHideHeader ?? false;
Model.IsUseColumnFilter = Model.IsUseColumnFilter ?? true;
}
<table id="@Model.Id" class="@(Model.TableClass ?? string.Empty)">
<thead>
@if (Model.IsUseColumnFilter == true)
{
<tr>
@for (int i = 0; i < Model.Columns.Count; i++)
{
<th></th>
}
</tr>
}
@if (Model.IsHideHeader != true)
{
<tr>
@foreach (var column in Model.Columns)
{
<th class="@column.CssClassHeader" @Html.Raw(string.IsNullOrWhiteSpace(column.AdditionalAttributeHeader) ? string.Empty : column.AdditionalAttributeHeader)>@column.DisplayName</th>
}
</tr>
}
</thead>
@if (Model.IsShowFooter == true)
{
<tfoot>
<tr>
@for (int i = 0; i < Model.Columns.Count; i++)
{
<th></th>
}
</tr>
</tfoot>
}
<tbody>
<tr>
<td colspan="@Model.Columns.Count" class="dataTables_empty">
Loading...
</td>
</tr>
</tbody>
</table>