I want to configure search widget for all layers in map. Right now, it searches for pre-configured layers and pre-configured columns. Is it possible to configure it for all columns of all layers ?
Also how do I display the search results in attribute table ?
Thank you,
Roger,
I suppose it would be possible, just impractical and would require a bit of coding. To open the results in the AT widget you would have to create a FeatureLayer from the results and open it in the AT widget just like did in your other thread.
I was able to do that by making following changes in widget.js file of search widget
Now only problem with this approach is, it displays search results in attribute tables after it finishes searching all the layers configured in search widget and it is taking more time (more than 1 minute sometimes) I wanted to check if there is any way to do this sequentially. i.e displaying search results in attribute table layer by layer.
Roger,
It is no clear from your code which function are you adding this code to?.. Is it the _onSearchResults, _onSuggestResults or _onSelectSearchResult?
in _onSearchResults function
Roger,
You would need to move your code up into the:
for(var i in results) {
for loop then.
Robert,
_onSearchResults function is called after search is finished. 'evt' object has seachresults object and search string.
I have configured all layers of my webmap in search widget (around 30). It takes around 35-45 seconds to finish search on all the layers and then it returns all results at once in _onSearchResults function. Because of this behavior, user has to wait for that much time. Instead I wanted to check if there is anyway to get search result one by one and process it. In that way, atleast user can see the progress instead of waiting for all the search results at once.
Roger,
Since there is not another event to attach to the fire after each source is searched the answer is no.
Roger,
I'm running into some issues when trying to get your solution to work. It looks like it crashes when it gets to the following line item: featureSetAndLayerObj.featureSet = new FeatureSet();