[UPDT] PAYROLL: HTMX for CRUD operation in table data

This commit is contained in:
Horilla
2024-02-12 13:03:26 +05:30
parent c89c723ca3
commit f35cfcd43b
6 changed files with 105 additions and 48 deletions

View File

@@ -30,7 +30,6 @@ function getCookie(name) {
return cookieValue;
}
var originalConfirm = window.confirm;
// Override the default confirm function with SweetAlert
window.confirm = function (message) {
@@ -73,6 +72,15 @@ window.confirm = function (message) {
htmx.ajax("GET", path, hxTarget);
}
}
} else {
var path = event.target["htmx-internal-data"].path;
var verb = event.target["htmx-internal-data"].verb;
var hxTarget = $(event.target).attr("hx-target");
if (verb === "post") {
htmx.ajax("POST", path, hxTarget);
} else {
htmx.ajax("GET", path, hxTarget);
}
}
} else {
}