I have created a feature layer given on https://developers.arcgis.com/javascript/3/jssamples/fl_featureCollection.html in custom widget. I tried to bind the programmatically created Feature layer with ESRI search widget. Here is my code
The layer doesn't appear in search widget.
Thanks in advance.
Kumar
Kumar,
A FeatureLayer coming from a FeatureCollection has this limitation:
So you can not use it with the Search widget.
Thanks Robert.
Any other suggestion to search the feature in FeatureLayer coming from a FeatureCollection?
Kumar,
I don't know of any way other than to loop through the graphics and check for that attribute value. If the FeatureCollection is coming from a map service initially then you can run the query on map service and get the ObjectID of the result you want and then loop through the FeatureCollection to get that OID.
Roberts Thanks.
What I am basically doing is getting data from web service and than creating a feature layer using feature layer definition followed by populated that data as features. This is working fine.
Now I like to add that feature layer in search widget. I understand from your previous reply that it cannot be queried against the feature collection due to it limitation.
If I understood correctly, manually created feature layer cannot be added to search widget.
Kumar,
That is correct based on my knowledge.