SearchBox.createResultSuggestionImage method

[SearchBox is no longer available for use as of Windows 10. Instead, use AutoSuggestBox. ]
Creates the image argument for appending result suggestions when handling the suggestionsrequested event.
Syntax
searchBox.createResultSuggestionImage(url);
Parameters
- url
-
Type: String
The URL of the image.
Return value
Required image argument for the SearchSuggestionCollection.appendResultSuggestion method.
Remarks
Creates the image argument for SearchSuggestionCollection.appendResultSuggestion when handling the suggestionsrequested event.
The source code for this method can be found in the WinJS library (see SearchBox.js).
Examples
The following code snippet stems from the full Searchbox with provided suggestions example.
function suggestionsRequestedHandler(eventObject) { var queryText = eventObject.detail.queryText, if (queryText.length > 0) { suggestionCollection.appendResultSuggestion("Mint", "Minty Mint", null, WinJS.UI.SearchBox.createResultSuggestionImage("/images/fruits/60Mint.png"), ""); } } var searchBox = document.getElementById("searchBoxId"); searchBox.addEventListener("suggestionsrequested", suggestionsRequestedHandler); WinJS.UI.processAll();
Requirements
|
Minimum WinJS version |
WinJS 3.0 |
|---|---|
|
Namespace |
WinJS.UI |
See also