Hi Randy,
Thanks for contacting Syncfusion support.
We maintain an internal variable called “noresult”. This variable returns a boolean value to indicate whether the autocomplete value is matched with the datasource or not. If the value is matched with the datasource then false will be returned. If it is not matched, then true will be returned. In the “keyup” event, you can use this variable to identify whether the value is matched with the Autocomplete datasource or not. Please refer the following code,
//Object for Autocomplete created autocompleteObj = $('#flowerslist').data("ejAutocomplete"); $('#flowerslist').on("keyup", function () { //retruns whether the value is present in the datasource or not console.log(autocompleteObj.noresult); }); |
We have attached a sample for your reference, please check it
http://jsplayground.syncfusion.com/m0l5vwd0
If you need any other assistance, please get back to us and we will be happy to help you.
Regards,
HariKrishnan
function onPopupOpen(args) { this.showSuggestionBox = this._isOpened = true; setTimeout(function () { if (!autocompleteObj.noresult) autocompleteObj.hide(); },200); } |