Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Commit

Permalink
(GH-52) Add row template
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Aug 2, 2020
1 parent 773a391 commit 838decf
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions src/Cake.Issues.Reporting.Generic/Templates/DxDataGrid.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,25 @@
},
rowAlternationEnabled: true,
allowColumnResizing: true,
rowTemplate: function (container, item) {
var data = item.data,
markup = "<tbody class='issue dx-row " + ((item.rowIndex % 2) ? 'dx-row-alt' : '') + "'>" +
"<tr class='main-row'>" +
"<td>" + data.ProviderName + "</td>" +
"<td>" + data.PriorityName + "</td>" +
"<td>" + data.Project + "</td>" +
"<td>" + data.Path + "</td>" +
"<td>" + data.File + "</td>" +
"<td>" + data.Line + "</td>" +
"<td>" + data.Rule + "</td>" +
"</tr>" +
"<tr class='message-row'>" +
"<td colspan='7'><div>" + data.Message + "</div></td>" +
"</tr>" +
"</tbody>";
container.append(markup);
},
columns: [
@if (providerTypeVisible)
{
Expand Down Expand Up @@ -494,26 +513,6 @@
},
</text>
}
@if (messageVisible)
{
<text>
{
caption: "Message",
dataField: "MessageHtml",
encodeHtml: false,
visibleIndex: @((int)ReportColumn.Message),
@if (groupedColumns.Contains(ReportColumn.Message))
{
@:groupIndex: @groupedColumns.IndexOf(ReportColumn.Message),
}
@if (sortedColumns.Contains(ReportColumn.Message))
{
@:sortIndex: @sortedColumns.IndexOf(ReportColumn.Message),
@:sortOrder: "@messageSortOrder.ToShortString()",
}
},
</text>
}
@foreach (var additionalColumn in additionalColumns)
{
<text>
Expand Down Expand Up @@ -547,4 +546,4 @@
});
</script>
</body>
</html>
</html>

0 comments on commit 838decf

Please sign in to comment.