I am looking for some example of setting the default search service to all(feature layer and esri geocoding). but I also care about the order of the results returned.
I suspect this is accomplished using the activeSource parameter of the search widget. But have not been able to find an example of this implemented.
I have tried implementing like this..
and also like this...
But both return this error...
dojo.js:340 Uncaught TypeError: [accessor] cannot assign to read-only property 'activeSource' of esri.widgets.Search.SearchViewModel
Any help is greatly appreciated.
As you can see from your error the activeSource property is readonly
what you need to use is activeSourceIndex which will let you set the number/index of the source.
I have not seen any example of it being implemented either. It is a simple property that you set either in the constructor or after creating the widget instance, so nothing special to show in code.