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 23, 2020
1 parent c45ecf4 commit 094191e
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 @@ -208,6 +208,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 @@ -647,26 +666,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 @@ -700,4 +699,4 @@
});
</script>
</body>
</html>
</html>

0 comments on commit 094191e

Please sign in to comment.