jquery-tokeninput
jquery-tokeninput copied to clipboard
Issue #450 showing all results on focus without having to enter any query
This applies to situation when settings.minChars is set to 0
Example of how to enable this when initializing the plugin?
just set minChars to 0
Tried that but nothing happens on click - I have to enter at least one char. No error is returned.
My code:
$("input.types").tokenInput("types.php",{
method: "POST",
queryParam: "term",
noResultsText: "No Results.",
minChars: 0,
showing_all_results: true,
deleteText: "<i class='ss-icon ss-delete'></i>",
hintText: 'Enter keyword',
prePopulate: <?php echo $types ?>
});
Tested in Safari and Chrome on mac.
What if you bind an event handler to the focus event where you manually trigger the keypress event. Or keyup, or keydown. Whatever prompts the search to execute. On Jan 10, 2013 6:01 PM, "quadrant6" [email protected] wrote:
Tried that but nothing happens - I have to enter at least one char. No error is returned.
My code:
$("input.types").tokenInput("types.php",{ method: "POST", queryParam: "term", noResultsText: "No Results.", minChars: 0, showing_all_results: true, deleteText: "", hintText: 'Type a category name', prePopulate: });
— Reply to this email directly or view it on GitHubhttps://github.com/loopj/jquery-tokeninput/pull/452#issuecomment-12123500.
line #738 needed to be changed as well for it to work:
from:
if(query && query.length) {
to:
if((query && query.length) || (query == "" && showing_all_results())) {