partial update detail opnames page
This commit is contained in:
@@ -16,34 +16,3 @@ let table = $("#opnames-table").DataTable({
|
||||
{ data: "action", name: "action", orderable: false, searchable: false },
|
||||
],
|
||||
});
|
||||
$(document).on("click", ".btn-product-stock-dealers", function () {
|
||||
const productId = $(this).data("id");
|
||||
const productName = $(this).data("name");
|
||||
const ajaxUrl = $(this).data("url");
|
||||
|
||||
// Set product name in modal title
|
||||
$("#product-name-title").text(productName);
|
||||
|
||||
// Initialize or reload DataTable inside modal
|
||||
$("#dealer-stock-table").DataTable({
|
||||
destroy: true, // reinit if exists
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: ajaxUrl,
|
||||
data: {
|
||||
product_id: productId,
|
||||
},
|
||||
},
|
||||
columns: [
|
||||
{ data: "dealer_name", name: "dealer_name" },
|
||||
{ data: "system_stock", name: "system_stock" },
|
||||
{ data: "physical_stock", name: "physical_stock" },
|
||||
{ data: "difference", name: "difference" },
|
||||
{ data: "opname_date", name: "opname_date" },
|
||||
],
|
||||
});
|
||||
|
||||
// Show the modal
|
||||
$("#dealerStockModal").modal("show");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user