88 lines
2.9 KiB
Plaintext
88 lines
2.9 KiB
Plaintext
@page
|
|
@model WorkFlowCheck.Web.Pages.BaseStock.CheckPoints.CheckPointsPageModel
|
|
@using Microsoft.AspNetCore.Antiforgery
|
|
@inject IAntiforgery Antiforgery
|
|
@{
|
|
ViewData["Title"] = "Ellenőrzési pontok";
|
|
}
|
|
<h1>@ViewData["Title"]</h1>
|
|
|
|
<div class="card shadow p-4">
|
|
<div class="d-flex justify-content-end">
|
|
<button class="btn btn-primary float-right">Új elem hozzáadása</button>
|
|
</div>
|
|
<table id="tbCheckPointsPage" class="table table-bordered table-hover table-sm" style="width:100%">
|
|
<thead class="table-primary">
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Short Name</th>
|
|
<th>Code</th>
|
|
<th class="text-center">Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tfoot class="table-light">
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Short Name</th>
|
|
<th>Code</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
|
|
@section Scripts {
|
|
<script>
|
|
const table = new DataTable('#tbCheckPointsPage', {
|
|
ajax: {
|
|
url: "@Url.Page("./CheckPointsPage", "LoadCheckPoints")",
|
|
type: "GET",
|
|
dataSrc : "data"
|
|
},
|
|
columns: [
|
|
{ data: "id" },
|
|
{ data: "shortName" },
|
|
{ data: "code" },
|
|
{ data: null, render: function (data, type, row) {
|
|
return renderActionButtons(row.id);
|
|
}}
|
|
],
|
|
columnDefs: [
|
|
{
|
|
"targets": 0,
|
|
"visible": false
|
|
},
|
|
{
|
|
"targets": 3,
|
|
"className": "text-center",
|
|
"width": "10%"
|
|
}
|
|
],
|
|
|
|
processing:true,
|
|
language: { url: '//cdn.datatables.net/plug-ins/2.2.2/i18n/hu.json',}
|
|
});
|
|
|
|
$('#tbCheckPointsPage').on('click', '.edit-btn', function ()
|
|
{
|
|
const row = table.row($(this).closest('tr')).data();
|
|
window.location.href = `@Url.Page("./CheckPointEditPage")?id=${row.id}`;
|
|
});
|
|
|
|
$('#tbCheckPointsPage').on('click', '.delete-btn', function ()
|
|
{
|
|
const row = table.row($(this).closest('tr')).data();
|
|
console.log(row);
|
|
showConfirmModal({
|
|
title: 'Törlés megerősítése',
|
|
message: 'Biztosan törölni szeretnéd ezt az elemet?',
|
|
okText: 'Törlés',
|
|
cancelText: 'Mégsem'
|
|
}).then(function(result) {
|
|
if(result === 'ok') {
|
|
console.log('Törlés végrehajtva');
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
} |