In this (hopefully) reproducible example, my search field is "Region". The search shows values of the first field of the table, that being "Sitename L". Is there a way to change the suggestion?
let searchWidget = new Search({
view: view,
maxSuggestions: 6,
sources: [
{
layer: fish,
searchFields: ["Region"],
name: "fish",
zoomScale: 500000,
maxSuggestions: 6,
suggestionsEnabled: true,
}
]
});
Search:
Table:
Solved! Go to Solution.
Yes, you can accomplish this by assigning a value to the suggestionTemplate property. You'll also want to set the outFields property to ensure that values for any fields you use in the template are being returned.
Yes, you can accomplish this by assigning a value to the suggestionTemplate property. You'll also want to set the outFields property to ensure that values for any fields you use in the template are being returned.