FEAT_SWAL_FOR_ROW_REMOVE_NONEB

This commit is contained in:
Srinivas-Saravanan 2025-05-29 10:48:31 +05:30
parent 193591f482
commit c8627c8724

View File

@ -1652,7 +1652,7 @@
collapsibleBar.innerHTML = ` collapsibleBar.innerHTML = `
${tableData ? tableData.table_name : "Particulars"} ${tableData ? tableData.table_name : "Particulars"}
<span class="collapse-icon"></span> <span class="collapse-icon"></span>
`; `;
// Create table content wrapper with Bootstrap 4 collapse class // Create table content wrapper with Bootstrap 4 collapse class
const tableContent = document.createElement('div'); const tableContent = document.createElement('div');
@ -2623,6 +2623,8 @@
if (rfq_or_qcr == 2) { if (rfq_or_qcr == 2) {
$("#openQCR").hide(); $("#openQCR").hide();
} }
} else {
$('#rfq_primaryKey').val(response.id);
} }
// window.location.reload(); // window.location.reload();
} else { } else {
@ -3750,14 +3752,30 @@
} }
function removeRowQCR(event) { function removeRowQCR(event) {
const button = event.target; Swal.fire({
const row = button.closest('tr'); title: 'Are you sure?',
const table = row.closest('table'); text: "Do you want to remove the row?",
if (row && row.parentElement.children.length > 1) { icon: 'warning',
// // console.log("Row Removed"); showCancelButton: true,
row.remove(); confirmButtonColor: '#d33',
updateVisisbleSNO(table.id); cancelButtonColor: '#3085d6',
} confirmButtonText: 'Yes, remove it!',
cancelButtonText: 'Cancel'
}).then((result) => {
if (result.isConfirmed) {
const button = event.target;
const row = button.closest('tr');
const table = row.closest('table');
if (row && row.parentElement.children.length > 1) {
// // console.log("Row Removed");
row.remove();
updateVisisbleSNO(table.id);
}
isFormDataModified = true; // if any value changeing in the table to set true
}
})
} }
function updateVisisbleSNO(tableId) { function updateVisisbleSNO(tableId) {
@ -5704,6 +5722,7 @@
}); });
}); });
} }
</script> </script>