Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Results (fixed) - Fork of @dmitov PR #340

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

johann-beessip
Copy link

Hi all,

This is a PR that is a fork of:
#215

That fixes the issue @kevinLay7 found:

I was able to get this working using @dmitov code. There is an error in the PR though. In his PR file: src/core.js Line 311 should be $listContainer.append("<li><div class='eac-item'>" + config.get("noResults") + "</div></li>");

I've also created a release for this on my fork that can be used until this is merged.
npm install --save https://github.com/johann-beessip/EasyAutocomplete/releases/download/v1.3.6/EasyAutocomplete-1.3.6.tar.gz

@pawelczak - would be great to get this merged.

@dan-owen
Copy link

dan-owen commented Dec 15, 2020

Just a quick note to help anyone else who might stumble across this super useful addition to easy-autocomplete.

When setting it up, make sure the #eac-container-search-autocomplete in the following is the id of your easy-autocomplete-container (it is probably going to be the same as what i have here unless you modified it).

list: {
	onLoadEvent: function () {
		if ($("#eac-container-search-autocomplete").val() !== '') {
			var elementCount = $("#eac-container-search-autocomplete").getElementCount();
			if (elementCount <= 0) {
				$('#no-results').show();
			}
			else {
				$('#no-results').hide();
			}
		}
	}
},
noResults: 'My no results message goes here',

The noResults bit at the end is what had me stumped as it wasn't mentioned anywhere!
I hope this helps someone else to go slighly less crazy :^D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants