HU a datatables-hez

This commit is contained in:
2025-03-19 09:59:42 +01:00
parent 2fd147bb36
commit f74922d01e
10 changed files with 78 additions and 18 deletions
@@ -7,7 +7,9 @@
<div class="card shadow p-4">
<div class="d-flex justify-content-end">
<button id="newUserBtn" class="btn btn-primary float-right new-btn">Új elem hozzáadása</button>
<button id="newUserBtn" class="btn btn-primary float-right new-btn" data-bs-toggle="tooltip" data-bs-placement="top" title="Új felhasználó">
<i class="bi bi-plus-square"></i>
</button>
</div>
<table id="tbUsersPage" class="table table-bordered table-hover table-sm" style="width:100%">
<thead class="table-primary">
@@ -63,7 +65,8 @@
}
],
processing:true
processing:true,
language: { url: '//cdn.datatables.net/plug-ins/2.2.2/i18n/hu.json',}
});
$('#newUserBtn').on('click', function ()
@@ -71,13 +74,13 @@
console.log('New button clicked!"');
window.location.href = `@Url.Page("./UserEditPage")?id=0`;
});
$('#tbUsersPage').on('click', '.edit-btn', function ()
{
const row = table.row($(this).closest('tr')).data();
window.location.href = `@Url.Page("./UserEditPage")?id=${row.id}`;
});
$('#tbUsersPage').on('click', '.delete-btn', function ()
{
const row = table.row($(this).closest('tr')).data();