Skip to content

Instantly share code, notes, and snippets.

@brightrain
Created February 11, 2015 01:03
Show Gist options
  • Save brightrain/23f4f68a0f3ed79c6fc8 to your computer and use it in GitHub Desktop.
Save brightrain/23f4f68a0f3ed79c6fc8 to your computer and use it in GitHub Desktop.
typeahead setup all
$("#searchInput").typeahead({
// how many characters does the user type before suggestions start firing
minLength: 3,
highlight: true,
hint: false
}, {
name: "camp",
displayKey: "name",
source: campBH.ttAdapter(),
// what the header looks like for this source in the suggestions drop down
templates: {
header: "<h1 class='typeahead-header'><span class='icon icon-camp'></span>&nbsp;Campgrounds</h1>"
}
}, {
name: "trail",
displayKey: "name",
source: trailBH.ttAdapter(),
templates: {
header: "<h1 class='typeahead-header'><span class='icon icon-trail'></span>&nbsp;Trail Heads</h1>"
}
}, {
name: "ski",
displayKey: "name",
source: skiBH.ttAdapter(),
templates: {
header: "<h1 class='typeahead-header'><span class='icon icon-ski'></span>&nbsp;Ski Areas</h1>"
}
}, {
name: "esri-geocoder",
displayKey: "name",
source: esriBH.ttAdapter(),
templates: {
header: "<h1 class='typeahead-header'><span class='icon icon-map-marker'></span>&nbsp;Addresses and Places</h1>"
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment