Trying to get the new Search running against a feature layer. enableSuggestions and enableSuggestionsMenu are false. Don't see anything else in docs which warns of 10.3/supportsPagination = true.
Any help appreciated.
sources: [{
featureLayer: new FeatureLayer('.../Parcels/FeatureServer/0', {
outFields: ['*']
}),
searchFields: ['ADDRESS', 'PARCEL_ID', 'OWNER'],
displayField: 'ADDRESS',
exactMatch: false,
outFields: ['*'],
name: 'Parcels',
placeholder: 'Search parcels',
enableSuggestions: false,
enableSuggestionsMenu: false,
minCharacters: 3
}]
Solved! Go to Solution.
Hi Guys,
Just to inform all that I got rid of this error for a feature layer from a map service(mapserver/0) simply by checking if pagination is supported or not for all the sources inside a for loop. Here is the code snippet:
search.on("load", function () {
var sources = search.sources;
sources.push({
featureLayer: layer,
enableLabel: false,
searchFields: ["STATE_NAME"],
displayField: "STATE_NAME",
exactMatch: false,
outFields: ["*"],
infoTemplate: new InfoTemplate("Ecological Footprint", "<a href= ${URL} target=_blank ;'>Additional Info</a></br></br>OBJECTID : ${OBJECTID }</br>")
});
for(i=0;i<sources.length;i++)
{
var supported;
if (sources.featureLayer) {
// supports pagination
if (sources.featureLayer.advancedQueryCapabilities && sources.featureLayer.advancedQueryCapabilities.supportsPagination) {
supported = true;
}
}
if (!supported) {
sources.maxResults = "food";
}
}
search.set("sources", sources);
});
search.startup();
I am attaching a working sample application along with this as well.
Hope that helps.....
Regards,
Nikhil. !
Hi Guys,
Just to inform all that I got rid of this error for a feature layer from a map service(mapserver/0) simply by checking if pagination is supported or not for all the sources inside a for loop. Here is the code snippet:
search.on("load", function () {
var sources = search.sources;
sources.push({
featureLayer: layer,
enableLabel: false,
searchFields: ["STATE_NAME"],
displayField: "STATE_NAME",
exactMatch: false,
outFields: ["*"],
infoTemplate: new InfoTemplate("Ecological Footprint", "<a href= ${URL} target=_blank ;'>Additional Info</a></br></br>OBJECTID : ${OBJECTID }</br>")
});
for(i=0;i<sources.length;i++)
{
var supported;
if (sources.featureLayer) {
// supports pagination
if (sources.featureLayer.advancedQueryCapabilities && sources.featureLayer.advancedQueryCapabilities.supportsPagination) {
supported = true;
}
}
if (!supported) {
sources.maxResults = "food";
}
}
search.set("sources", sources);
});
search.startup();
I am attaching a working sample application along with this as well.
Hope that helps.....
Regards,
Nikhil. !