benlam

How to make the feature count variable global?

Discussion created by benlam on Nov 22, 2012
Latest reply on Nov 27, 2012 by geos_rfleet
It may be a simple answer but I need help:
The following works but I need to put the 'count' variable into a global one so that I can use it in other functions.


function countfeat(type,select) {
  var selectedOption=select.options[select.selectedIndex];
  query = new esri.tasks.Query();
  query.where = type + " Like '%" + selectedOption.value + "%'";
  queryTask = new esri.tasks.QueryTask("http://vdid-gisedn-2:8399/arcgis/rest/services/flow_BRID/MapServer/0");
  queryTask.executeForCount(query, function(count){
  dojo.byId('rightPane').innerHTML = count;
  });
};


Thanks
Ben

Outcomes