search cell: display only results of the last request (#18916)
This commit is contained in:
parent
b1c045204f
commit
ec6fb3d109
|
@ -14,11 +14,14 @@ $(function() {
|
|||
var combo_search_form_{{ cell.pk }} = $('#combo-search-form-{{ cell.pk }}');
|
||||
var combo_search_input_{{ cell.pk }} = $('#combo-search-input-{{ cell.pk }}');
|
||||
var combo_search_results_{{ cell.pk }} = $('#combo-search-results-{{ cell.pk }}');
|
||||
var xhr = null;
|
||||
|
||||
function combo_search_update_{{ cell.pk }}() {
|
||||
$.get(combo_search_input_{{ cell.pk }}.data('autocomplete-json'),
|
||||
if (xhr) xhr.abort();
|
||||
xhr = $.get(combo_search_input_{{ cell.pk }}.data('autocomplete-json'),
|
||||
{'q': combo_search_input_{{ cell.pk }}.val()},
|
||||
function (response) {
|
||||
xhr = null;
|
||||
combo_search_results_{{ cell.pk }}.html(response);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue