fix redirect back reklame and tourisms
This commit is contained in:
@@ -13,10 +13,10 @@ class GeneralTable {
|
||||
|
||||
init() {
|
||||
const tableContainer = document.getElementById(this.tableId);
|
||||
|
||||
|
||||
// Kosongkan container sebelum render ulang
|
||||
tableContainer.innerHTML = "";
|
||||
|
||||
|
||||
const table = new Grid({
|
||||
columns: this.columns,
|
||||
search: this.options.search || {
|
||||
@@ -47,7 +47,7 @@ class GeneralTable {
|
||||
total: (data) => data.meta.total,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
table.render(tableContainer);
|
||||
this.handleActions();
|
||||
}
|
||||
@@ -88,13 +88,15 @@ class GeneralTable {
|
||||
handleCreate(event) {
|
||||
// Menggunakan model dan ID untuk membangun URL dinamis
|
||||
const model = event.target.getAttribute("data-model"); // Mengambil model dari data-model
|
||||
window.location.href = `${this.baseUrl}/${model}/create`;
|
||||
let menuId = event.target.getAttribute("data-menu");
|
||||
window.location.href = `${this.baseUrl}/${model}/create?menu_id=${menuId}`;
|
||||
}
|
||||
|
||||
handleBulkCreate(event) {
|
||||
// Menggunakan model dan ID untuk membangun URL dinamis
|
||||
const model = event.target.getAttribute("data-model");
|
||||
window.location.href = `${this.baseUrl}/${model}/bulk-create`;
|
||||
let menuId = event.target.getAttribute("data-menu");
|
||||
window.location.href = `${this.baseUrl}/${model}/bulk-create?menu_id=${menuId}`;
|
||||
}
|
||||
|
||||
// Fungsi untuk menangani edit
|
||||
@@ -103,7 +105,8 @@ class GeneralTable {
|
||||
const model = event.target.getAttribute("data-model"); // Mengambil model dari data-model
|
||||
console.log("Editing record with ID:", id);
|
||||
// Menggunakan model dan ID untuk membangun URL dinamis
|
||||
window.location.href = `${this.baseUrl}/${model}/${id}/edit`;
|
||||
let menuId = event.target.getAttribute("data-menu");
|
||||
window.location.href = `${this.baseUrl}/${model}/${id}/edit?menu_id=${menuId}`;
|
||||
}
|
||||
|
||||
// Fungsi untuk menangani delete
|
||||
|
||||
Reference in New Issue
Block a user