Drop down list

5129
16
06-03-2015 05:11 AM
SatyanarayanaNarmala
New Contributor III

Hi,

i am trying to implement drop down list. the first list shows state list, second list shows district and third one shows villages.

when the user selects a state from first list box then the map should zoom to that particular state polygon. and same for other two list boxs.

i have tried but the zoom to selected does not working for me.

can anyone guide me in this.

Regards,

satya

0 Kudos
16 Replies
PriyaRanjanJena
New Contributor II

Thanks for the code.

But I am facing a problem when state is selected then Country list is populated, again when another state is selected then country name are populated with the previous values. How to clear the dropDown before populating the values.

Thanks.

0 Kudos
SatyanarayanaNarmala
New Contributor III

Hi priya,

Can share your code

0 Kudos
PriyaRanjanJena
New Contributor II

I used the same code by you did not change any thing.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

I added the following line to the queryFeatures method:

registry.byId("countyName").get('store').data = [];

Here is a working fiddle example.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Hi Priya,

You will need to set the datastore of the combobox dijit to an empty array.  Ex:

countyLayer.queryFeatures(query, function(featureSet) {
  var countyList = [];
            
  dojo.map(featureSet.features, function(feature) {
    countyList.push(feature.attributes.name);
  });  
  
  countyList.sort();       
  
  registry.byId("countyName").get('store').data = [];                   
  
  arrayUtils.forEach(countyList, function(feature){                          
        registry.byId("countyName").get('store').add({ name: feature});                                  
  })                                                                  
});
PriyaRanjanJena
New Contributor II

Thanks Jake.

Is there any way to display the country name and add a popup window on click event to display other details about the country ?

0 Kudos
JeffJacobson
Occasional Contributor III

If you don't mind combining all three boxes' functionality into a single box, you could use the Search widget.

0 Kudos