Bug 31085: Reload return claims table on resolve

This is another fix for a bug in return claims. We now test for the
initialised datatable and call an ajax reload directly on it if we find
one instead of calling a undefined function (the function is out of
scope here).

NOTE: Taken as a whole commit follow-up on bug 28854 where the issue was
initially identified

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2022-06-27 17:53:15 +01:00 committed by Tomas Cohen Arazi
parent 41ce80eb12
commit 2485476b71
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -30,9 +30,11 @@ $(document).on('click', '#claims-returned-resolved-modal-btn-submit', function(e
success: function(data) {
$('#claims-returned-resolved-modal-btn-submit-spinner').hide();
$('#claims-returned-resolved-modal-btn-submit-icon').show();
$('#claims-returned-resolved-modal').modal('hide')
$('#claims-returned-resolved-modal').modal('hide');
refreshReturnClaimsTable();
if ( $.fn.dataTable.isDataTable("#return-claims-table") ) {
$("#return-claims-table").DataTable().ajax.reload();
}
},
contentType: "json"
});