abort previous ajax request when creating new one
abort previous ajax request when creating new one
aedion
Posts: 2Questions: 0Answers: 0
here "my SetUp"
var table = $('#dt_list').DataTable({
"scrollX": true,
"scrollCollapse": true,
"columnDefs": [
{"targets": 2, "width": "1%"},
{"targets": 1, "width": "1%"},
{"targets": 3, "width": "1%", "sClass": "aligRight"},
{"targets": 4, "width": "1%", "sClass": "aligRight"},
{"targets": 5, "width": "1%", "sClass": "aligRight"},
],
"order": [[0,"asc"]],
"searchDelay": 2000,
"processing": true,
"language": { processing: '<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i><span class="sr-only">Loading...</span> '},
"serverSide": true,
"ajax": {
"url": "url.php",
"type": "POST",
"data": function ( data, settings ) {
data.page = "filter_product2";
data.category = $('#category').val();
data.brand = $('#brand').val();
data.stock = $("input[name='stock']:checked").val();
data.atributeid = [];
data.atributevalue = [];
$("#divsearch .atributeid").each(function() {
data.atributeid.push($(this).val());
});
$("#divsearch .atributevalue").each(function() {
data.atributevalue.push($(this).val());
});
}
}
})
how to abort preivous ajax request when creating new one?
sorry for my bad english.
This discussion has been closed.
Replies
Hi @aedion ,
This thread should help, it's asking the same thing.
Cheers,
Colin