How to display all results returned by search widget

2703
8
08-02-2018 09:08 AM
CongDo
by
New Contributor II

I'm starting with the example of search widget with multiple sources Search widget with multiple sources | ArcGIS API for JavaScript 4.8 

When I select my layer from the drop-down options the widget only highlight one value (the polygon was colored brown), probably the first it finds. For example, I let the user query by country name. Say the user enters "USA" I was hoping the widget would return a list of all polygon which have the field country filled with USA but instead it just highlight and zooms to the first result (while I'm sure there are more). When I use the Arcgis World geocoding service on the dropdown menu, the popup allows me to click on the "Show more results" but it doesn't appear when i use my layer. Is there anyway to do it or highlight all the polygon results ?

8 Replies
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
CongDo
by
New Contributor II

Thanks for reply.

I've set the autoSelect false but it just not highlight and zoom to the first result. I need to show the list of results (like the Arcgis World geocoding service option ) or highlight all of them.

RobertScheitlin__GISP
MVP Emeritus

Cong Do,

   Does your layer support suggestions? 

Suggestions are available if working with a 10.3 or later geocoding service that has suggest capability loaded or a 10.3 or later feature layer that supports pagination, i.e. supportsPagination = true

0 Kudos
CongDo
by
New Contributor II

the suggestions still work and show all results. But with the  Arcgis World geocoding service, after fill in the search field and press enter, the suggestions are closed, the popup appears and allows me to click on the "Show more results" to see all the result returned. How to do it with my layers or maybe can you tell me how to keep the suggestions still display after click on one of the results ?? 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Cong,

  So your layer (FeatureLayer) has to support suggestions are defined in my last post.

0 Kudos
CongDo
by
New Contributor II

Thanks for your help.

I've found out that the solution is using the default popup template of search widget.

MatthewDriscoll
MVP Alum

Could you show me the code to setting the popup template to default?   I am very new to JS and this is my first roadblock.

Edit:   

           My Problem:  It would only show me 6 of the results of the search.  I wanted be able to scroll through all results.

         

            Solution:  I set the maxSuggesttions to 1000000 now I can see all of the results with a scroll.

0 Kudos
LindsyHales_Bentley
New Contributor III

I am looking for this same answer. Are there any updates?

0 Kudos