explication d une fonction
Posté : 04 janv. 2022, 12:58
Bonjour qui peut m expliquer cette fonction.
$('#applyClickBulk').on('click', function(e){
e.preventDefault();
if($("#bulkSelectDrop").val() == "1"){
// $("#submitForAddListing").submit(); // Old
/* New */
var refIds = $(".checkMeAll:checkbox:checked").map(function(){ return $(this).val(); }).get();
$.ajax({
url: "{{ route('post.bulk.add.listings_alias') }}",
data: { 'bulk_links': refIds, },
type: 'POST',
success: function(res){
$('#reserrMsg').text(res.message);
$('#resmyModal').modal('show');
$.each(res.carInsertedIds, function(index, value){
var timeout = 1000 * ((index + 1) * 7);
// setTimeout(function(){ window.open("{{url('cpanel/cars/edit/')}}" + "/" + xxx); }, timeout);
window.open("{{url('cpanel/cars/edit/')}}" + "/" + xxx);
myTable.row($("tr#" + value.val + "-tr")).remove().draw();
});
$body.removeClass("loading");
},
error: function(error){
$('#reserrMsg').text(error.responseJSON.error);
$('#resmyModal').modal('show');
$body.removeClass("loading");
},
merci
$('#applyClickBulk').on('click', function(e){
e.preventDefault();
if($("#bulkSelectDrop").val() == "1"){
// $("#submitForAddListing").submit(); // Old
/* New */
var refIds = $(".checkMeAll:checkbox:checked").map(function(){ return $(this).val(); }).get();
$.ajax({
url: "{{ route('post.bulk.add.listings_alias') }}",
data: { 'bulk_links': refIds, },
type: 'POST',
success: function(res){
$('#reserrMsg').text(res.message);
$('#resmyModal').modal('show');
$.each(res.carInsertedIds, function(index, value){
var timeout = 1000 * ((index + 1) * 7);
// setTimeout(function(){ window.open("{{url('cpanel/cars/edit/')}}" + "/" + xxx); }, timeout);
window.open("{{url('cpanel/cars/edit/')}}" + "/" + xxx);
myTable.row($("tr#" + value.val + "-tr")).remove().draw();
});
$body.removeClass("loading");
},
error: function(error){
$('#reserrMsg').text(error.responseJSON.error);
$('#resmyModal').modal('show');
$body.removeClass("loading");
},
merci