NonInventPurchasingSystem/CPRNIMS.WebApps/wwwroot/JsFunctions/PR/AlterOffer.js
2026-01-20 07:44:30 +08:00

50 lines
1.4 KiB
JavaScript

$(document).ready(function () {
loader = $('#overlay, #loader');
prTable = $('#AlterOfferTable').DataTable({
ajax: {
url: endpoint.GetSupplierAlternativeOffer,
type: 'GET',
beforeSend: function () {
loader.show();
},
complete: function () {
loader.hide();
}
},
initComplete: initCompleteCallback,
columns: colOnAlterOfferTable,
responsive: true,
language: {
emptyTable: "No record available"
},
error: errorHandler
});
})
$(document).on('change', '.choose-alternative-checkbox', function () {
if (this.checked) {
// Uncheck others
$('.choose-alternative-checkbox').not(this).prop('checked', false);
// Reset all rows style
$('#AlterOfferListDataTable tbody tr').css({
'color': '',
'background-color': ''
});
// Highlight the selected row
$(this).closest('tr').css({
'color': 'white',
'background-color': 'green'
});
} else {
// If user unchecks (optional reset)
$(this).closest('tr').css({
'color': '',
'background-color': ''
});
}
});
function refreshAlterTable() {
prTable.ajax.reload();
prDataTable.ajax.reload();
}