How to cancel previous AJAX calls in DataTables
How to cancel previous AJAX calls in DataTables
![plazav](https://secure.gravatar.com/avatar/1a7e6e8708e823ac2cb740b2f6a89cf4/?default=https%3A%2F%2Fvanillicon.com%2F1a7e6e8708e823ac2cb740b2f6a89cf4_200.png&rating=g&size=120)
Dear community and moderators!
I know that there are a lot of posts on this forum and on Stackoverflow.
But there are still no clear answer of how it could be possible to cancel currently call.
I will describe my current situation: When I type search text in input field - it could happened that search order would be wrong. And I will receive result without last entered letter. I have set "searchDelay": 1000, but it doesn't help.
This question has an accepted answers - jump to answer
Answers
Hi @plazav,
This thread here may help, the proposed solution helped @JonnyEggins. Can you try that, please, and let us know if it works.
Cheers,
Colin
Thank you, @colin !
I have seeing this. But have no idea where does he has put
This thread has an interesting solution using debounce. Take a look at the last two posts.
Kevin
This js allows to add button and start search only after button click or enter.
Link to demo
I have decided to use it.
@plazav : nice, sorry, I missed your original reply, but that looks like a good solution![:) :)](https://datatables.net/forums/resources/emoji/smile.png)