RoleCheckListTemplateHeader lista nézet

This commit is contained in:
2025-03-27 12:11:34 +01:00
parent 04cca012f4
commit f119b196ea
3 changed files with 41 additions and 27 deletions
@@ -1,5 +1,5 @@
@page
@model WorkFlowCheck.Web.Pages.RoleCheckListTemplateHeadersAndRole.RoleCheckListTemplateHeadersPageModel
@model WorkFlowCheck.Web.Pages.UserAndRole.RoleCheckListTemplateHeadersPageModel
@{
ViewData["Title"] = "Szabályok - Ellenőrzési sablonok";
}
@@ -11,25 +11,21 @@
<i class="bi bi-plus-square"></i>
</button>
</div>
<table id="tbRoleCheckListTemplateHeaderssPage" class="table table-bordered table-hover table-sm" style="width:100%">
<table id="tbRoleCheckListTemplateHeadersPage" class="table table-bordered table-hover table-sm" style="width:100%">
<thead class="table-primary">
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>RoleCheckListTemplateHeaders Name</th>
<th>E-mail</th>
<th>Role name</th>
<th>Template name</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot class="table-light">
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>RoleCheckListTemplateHeaders Name</th>
<th>E-mail</th>
<th>Action</th>
<th>Role name</th>
<th>Template name</th>
<th class="text-center">Action</th>
</tr>
</tfoot>
</table>
@@ -37,18 +33,16 @@
@section Scripts {
<script>
const table = new DataTable('#tbRoleCheckListTemplateHeaderssPage', {
const table = new DataTable('#tbRoleCheckListTemplateHeadersPage', {
ajax: {
url: "@Url.Page("./RoleCheckListTemplateHeadersPage", "LoadRoleCheckListTemplateHeaderss")",
url: "@Url.Page("./RoleCheckListTemplateHeadersPage", "LoadRoleCheckListTemplateHeaders")",
type: "GET",
dataSrc : "data"
},
columns: [
{ data: "id" },
{ data: "firstName" },
{ data: "lastName" },
{ data: "RoleCheckListTemplateHeadersName" },
{ data: "email" },
{ data: "roleDTO.roleName" },
{ data: "checkListTemplateHeaderDTO.description" },
{ data: null, render: function (data, type, row) {
return renderActionButtons(row.id);
}}
@@ -59,7 +53,7 @@
"visible": false
},
{
"targets": 5,
"targets": 3,
"className": "text-center",
"width": "10%"
}
@@ -72,16 +66,16 @@
$('#newRoleCheckListTemplateHeadersBtn').on('click', function ()
{
console.log('New button clicked!"');
window.location.href = `@Url.Page("./RoleCheckListTemplateHeadersEditPage")?id=0`;
window.location.href = `@Url.Page("./RoleCheckListTemplateHeaderEditPage")?id=0`;
});
$('#tbRoleCheckListTemplateHeaderssPage').on('click', '.edit-btn', function ()
$('#tbRoleCheckListTemplateHeadersPage').on('click', '.edit-btn', function ()
{
const row = table.row($(this).closest('tr')).data();
window.location.href = `@Url.Page("./RoleCheckListTemplateHeadersEditPage")?id=${row.id}`;
window.location.href = `@Url.Page("./RoleCheckListTemplateHeaderEditPage")?id=${row.id}`;
});
$('#tbRoleCheckListTemplateHeaderssPage').on('click', '.delete-btn', function ()
$('#tbRoleCheckListTemplateHeadersPage').on('click', '.delete-btn', function ()
{
const row = table.row($(this).closest('tr')).data();
console.log(row);