I would like a search widget that onclick displays something similar to the screenshot attached. I would only want it on one of my feature layers. How do I go about doing so?
Please see my codepen:
Hi there,
This is my understanding of your question. I apologize if I did not understand the question. I think you are asking to run search when user clicks on features of a given feature layer and show a popupTemplate using results of the search. This codepen app shows a proof of concept for how it can be done: https://codepen.io/U_B_U/pen/oNaMVoe?editors=100
Essentially, you want to use MapView.hittest() to return a result only when user clicks on the featurelayer of your choice by setting includes parameter. If the hittest returns results then you can call search widget's search method using either attribute, geometry or long,lat. Once the search returns the result, then you can show the popup by calling view.popup.open() method. You can setup the action, content and title of the popup as needed.
Hope this helps,