FIX_ISSUE
This commit is contained in:
parent
233caee2eb
commit
ac3ae3e87a
@ -334,7 +334,7 @@ table.dataTable tbody td {
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" onclick="getPolicyTransactionDataForEdit('<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>')">
|
||||
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" onclick="alertEveryFiveSeconds('<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>')">
|
||||
<i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
|
||||
</a>
|
||||
|
||||
@ -490,6 +490,8 @@ var vehicle_list = ''; // local variable for storing the client policy list
|
||||
var branch_policy = '';
|
||||
var unit_list = '';
|
||||
var count = 0
|
||||
var getClientAndBranchAndPolicySuccess = false
|
||||
var intervalId = 0;
|
||||
|
||||
//for disable all field if client and client branch is empty
|
||||
$(document).ready(function() {
|
||||
@ -767,6 +769,9 @@ function getClientAndBranchAndPolicy(appendStatus = true)
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
},
|
||||
complete : function(){
|
||||
getClientAndBranchAndPolicySuccess = true
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1595,6 +1600,29 @@ function onlyNumbers(event)
|
||||
return false;
|
||||
}
|
||||
|
||||
function alertEveryFiveSeconds(id) {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
intervalId = setInterval(function () {
|
||||
|
||||
if (getClientAndBranchAndPolicySuccess === true) {
|
||||
|
||||
clearInterval(intervalId); // ✅ stop interval
|
||||
console.log('intervel cleared');
|
||||
getPolicyTransactionDataForEdit(id)
|
||||
console.log('getPolicyTransactionDataForEdit function called');
|
||||
|
||||
}else{
|
||||
console.log('intervel not cleared getClientAndBranchAndPolicy is still pending');
|
||||
}
|
||||
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user