No results found option
See original GitHub issueI know that I can specify an empty
template for each dataset, but I have 6 or 7 datasets and I would like to specify something to be displayed when none of the datasets have hits.
If I just type in “4q8nywrfxm”, I don’t want to see 6 datasets all saying that they can’t find that text, I just want one message, specified at the typeahead level (not the dataset level).
Does that make sense?
Issue Analytics
- State:
- Created 10 years ago
- Reactions:4
- Comments:27 (1 by maintainers)
Top Results From Across the Web
How do you modify "No Results Found" language in Select2 ...
The option noMatches doesn't appear anywhere in the source code. The actual option is named noResults. The working version of your example ...
Read more >No results found in all select fields - Development - Select2
“No results found” means that the current search term doesn't match any of the available options. So the other think I can think...
Read more >Select2 No Results Found Button - CodePen
1. /* Expand button to all of option */ ; 2 .select2-results__option.select2-results__message { ; 3. padding: 0px; ; 4. } ; 5. button#no-results-btn...
Read more >Is there a way to customize/style the "No results found ... - GitHub
You can return a jQuery element $() from that as well if you want some custom HTML. This appears to be more of...
Read more >Always get 'No results found' with ajax option - Google Groups
I'm trying to dynamically load the select2 options using the ajax feature but I keep getting the 'No results found' error even though...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @lucaspiller and @atrain0789
Here’s another approach building on the snippet from @lucaspiller:
I think I’ve found a simple solution for only showing one empty template, when working with multiple datasets.
1. Add an empty template to one dataset If you only want to show the message when ALL are empty, you only need to add one message.
2. Add event trigger keyup for the typeahead input field (.tt-input)
We don’t want to show an empty message is a suggestion from another dataset. So whenever there is more than 0 suggestions, we hide the empty-message.