Answer the question
In order to leave comments, you need to log in
How to popup a modal window if no match is found in autocomplete?
Good to everyone!
The task is this: there is an input field in which the uikit "autocomplete" component is used, it is necessary during the loss of focus if autocomplete did not find a match, display a modal window (which will offer to add data).
The problem actually is to display the modal only under this condition. I wanted to use 2 events
1. on("focusout" to catch the loss of focus
2. on('selectitem.uk.autocomplete' the component event fires if autocomplete in the field was used from the list.
The idea was that if the second event worked, then 1 do not use ... but it turns out that first it processes 1 event and only then 2.
It turned out to make such a crutch:
$('#UACProject').on('selectitem.uk.autocomplete', function(){
modal.hide();
});
$('#UACProject').on("focusout",".StartInpAjaxProject",function(){
modal.show();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question