Displaying Search Results
The final step is to display the matching search results in the Search Results page. I already created the Search Results Page in the previous section when I discussed using the Search charm. I will use the very same Search Results page with the SearchBox control.
When a user submits a search query from the SearchBox control then the querysubmitted event is raised. The My Notes app handles the querysubmitted event with the code in Listing 13.8.
LISTING 13.8 Handling the querysubmitted Event (\pages\home\home.js)
// Listen for search queriesvar search = document.getElementById("search").winControl;search.addEventListener("querysubmitted", function (e) { WinJS.Navigation.navigate("/pages/searchResults/searchResults.html" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access