Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GH-473) Add row template #480

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -275,6 +275,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 @@ -744,26 +763,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 @@ -797,4 +796,4 @@
});
</script>
</body>
</html>
</html>