Providing Search Suggestions
You can provide search suggestions as the user types by handling the SearchBox
control’s suggestionsrequested
event. The My Notes app uses the event handler in Listing 13.7.
// Handle requests for search suggestionsvar search = document.getElementById("search").winControl;search.addEventListener("suggestionsrequested", function (e) { var queryText = e.detail.queryText; var searchSuggestions = e.detail.searchSuggestionCollection; // Needed because we are async e.detail.setPromise( // Get all of the notes MyApp.notesDataSource.getAll().then(function (notes) { // Get matching ...
Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.