You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling with this one a little. I've been trying to output a message such as:
"Breaking Bad" couldn't be found in your collection.
in the designated "empty" template that I'm setting in data-templates
To do this I'm targeting the value of the input using jQuery and passing it off to a Session variable that I then call as a helper in my empty template. The call works except the query is always missing the final character. Strangely if I inspect the Session variable in my console, the full query is there.
Is there any reason why this shouldn't work with Typeahead?
Form template
<templatename="bookSearchForm"><formaction="/books/search" class="search searchBooks" method="post"><buttonclass="searchBooksButton"><iclass="fa fa-search"></i></button><inputid="searchBooksQuery" class="form-control typeahead" type="text"
placeholder="Search for books in your collection or to add a new one"
autocomplete="off" spellcheck="off"
data-source="books" data-select="selected" data-templates="searchItem;empty:searchNoItems" /></form></template>
Empty template
<templatename="searchNoItems"><divclass="search-no-results"><spanclass="lookupBook">{{ bookSearchValue }} not in your collection, hit enter to search for it.</span></div><!-- /.search-no-results --></template>
I'm struggling with this one a little. I've been trying to output a message such as:
in the designated "empty" template that I'm setting in
data-templates
To do this I'm targeting the value of the input using jQuery and passing it off to a Session variable that I then call as a helper in my empty template. The call works except the query is always missing the final character. Strangely if I inspect the Session variable in my console, the full query is there.
Is there any reason why this shouldn't work with Typeahead?
Form template
Empty template
JS
The text was updated successfully, but these errors were encountered: