feature: set role previledge access
This commit is contained in:
@@ -9,6 +9,11 @@ class PbgTasks {
|
||||
}
|
||||
|
||||
initTableRequestAssignment() {
|
||||
let tableContainer = document.getElementById("table-pbg-tasks");
|
||||
|
||||
// Pastikan kontainer kosong sebelum merender ulang Grid.js
|
||||
tableContainer.innerHTML = "";
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
new Grid({
|
||||
columns: [
|
||||
"ID",
|
||||
@@ -24,13 +29,24 @@ class PbgTasks {
|
||||
{
|
||||
name: "Action",
|
||||
formatter: function (cell) {
|
||||
let tableContainer = document.getElementById("table-pbg-tasks");
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
|
||||
if (!canUpdate) {
|
||||
return gridjs.html(`
|
||||
<span class="text-muted">No Privilege</span>
|
||||
`);
|
||||
}
|
||||
|
||||
return gridjs.html(`
|
||||
<div class="d-flex justify-content-center align-items-center gap-2">
|
||||
<a href="/pbg-task/${cell}" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">Detail</a
|
||||
<a href="/pbg-task/${cell}" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
Detail
|
||||
</a>
|
||||
</div>
|
||||
`);
|
||||
},
|
||||
},
|
||||
}
|
||||
],
|
||||
search: {
|
||||
server: {
|
||||
|
||||
Reference in New Issue
Block a user