SearchBox.searchHistoryContext property

[SearchBox is no longer available for use as of Windows 10. Instead, use AutoSuggestBox. ]

Gets or sets the search history context. This context is used a secondary key (the app ID is the primary key) for storing search history.

Syntax

<div 
    data-win-control="WinJS.UI.SearchBox" 
    data-win-options="{ searchHistoryContext : value}" >
</div>
var searchHistoryContext = searchBox.searchHistoryContext;
searchBox.searchHistoryContext = searchHistoryContext;

Property value

Type: String

The search history context.

Remarks

An app can use the search history context string to store different search histories based on the context of the application. If you don't set this property, the system assumes that all searches in your app occur in the same context. If you update this property while the search pane is open with suggestions showing, the changes won't take effect until the user enters the next character.

Requirements

Minimum WinJS version

WinJS 3.0

Namespace

WinJS.UI

See also

SearchBox