How I can cancel the pending request through bloodhound when the keyword is changed ?
var data = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
wildcard: '%QUERY',
url: $('div.job .typeahead').attr('data-autocomplete-url') + '?term=%QUERY',
ajax: {
async: true,
dataType: 'json',
crossDomain: true,
}
}
});
$('div.job .typeahead').typeahead(null, {
name: 'job',
displayKey: 'text',
limit: Infinity,
source: data
});