While using the Search Multiple Sources widget provided in the ArcGIS API for JavaScript Latest Samples
Search multiple sources | ArcGIS API for JavaScript
In this widget we have an observation on the search results return using the infoTemplate().
Where ever we use the sources as
sources.push({
featureLayer: new FeatureLayer("http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/CongressionalDistricts/FeatureServe..."),
searchFields: ["DISTRICTID"],
displayField: "DISTRICTID",
exactMatch: false,
outFields: ["DISTRICTID", "NAME", "PARTY"],
name: "Congressional Districts",
placeholder: "3708",
maxResults: 6,
maxSuggestions: 6,
//Create an InfoTemplate and include three fields
infoTemplate: new InfoTemplate("Congressional District", "District ID: ${DISTRICTID}</br>Name: ${NAME}</br>Party Affiliation: ${PARTY}"),
enableSuggestions: true,
minCharacters: 0
});
In the Line #12 we could see the info template has been configured.
and this going to return us the results in the below format:
and when we customize the Info template as below as
sources.push({
featureLayer: new FeatureLayer("http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/CongressionalDistricts/FeatureServe..."),
searchFields: ["DISTRICTID"],
displayField: "DISTRICTID",
exactMatch: false,
outFields: ["DISTRICTID", "NAME", "PARTY"],
name: "Congressional Districts",
placeholder: "3708",
maxResults: 6,
maxSuggestions: 6,
//Create an InfoTemplate and include three fields
infoTemplate: new InfoTemplate("", ""),
enableSuggestions: true,
minCharacters: 0
});
In the Line #12 we could see the info template has been configured to default which are null.
and this going to return us the results in the below format:
Here my query is can we customize the info Template to show the certain attributes and Show more results as like in the image#2.
So I am expecting the results to be in the below format
DistrictID
| Name
| Party
|
---|
3705 | Virginia Fox | republican |
3706 | xxxxx | xxxxx |
Where when user clicks on the DistrictID it navigate to the respective district.
Can some one please help in getting this designed ?
Did some one have seen this before ?
Robert Scheitlin, GISP
TAPAS DAS
Stan McShinsky