Thanks for your help, I think I'm getting close now.Here is the code I am using:
function showTResults(results){
dojo.forEach(results, function(result) {
var graphic = result.feature;
var fMarkerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 1), new dojo.Color([0, 255, 0, 0.25]));
var fLineSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([255, 0, 0]), 1);
var fPolygonSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NONE, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25]));
switch (graphic.geometry.type) {
case "point":
graphic.setSymbol(fMarkerSymbol);
cartstuff.push(graphic);
break;
case "polyline":
graphic.setSymbol(fLineSymbol);
cartstuff.push(graphic);
break;
case "polygon":
graphic.setSymbol(fPolygonSymbol);
break;
}
map.graphics.add(graphic);
});
};
function doFind(text) {
params.searchText = text;
find.execute(params, showTResults);
}
function download(){
var clipLayers = [];
var seismicCount = (jQuery("#selectedSeismicTable").getGridParam("reccount"));
var wellCount = (jQuery("#selectedSWellTable").getGridParam("reccount"));
if (seismicCount > 0) {
clipLayers.push('2D Seismic');
for (i = 1; i < seismicCount + 1; i++) {
var ref = $('#selectedSeismicTable').getCell(i, 1);
doFind(ref);
}
};
if ((jQuery("#selectedRPTable").getGridParam("reccount")) > 0) {
clipLayers.push('Regional Profiles');
};
if ((jQuery("#selectedWellTable").getGridParam("reccount")) > 0) {
clipLayers.push('Wells');
for (i = 1; i < wellCount + 1; i++) {
var ref = $('#selectedWellTable').getCell(i, 1);
//alert(ref);
doFind(ref);
}
};
var clipFeatureSet = new esri.tasks.FeatureSet();
clipFeatureSet.features = cartstuff;
var params = {
"Layers_to_Clip": clipLayers,
"Area_of_Interest": clipFeatureSet,
"Feature_Format": "Shapefile - SHP - .shp"
}
gp.submitJob(params, completeCallback, statusCallback, function(error){
alert(error);
});
}
function completeCallback(jobInfo){
if(jobInfo.jobStatus !== "esriJobFailed"){
gp.getResultData(jobInfo.jobId,"Output_Zip_File", downloadFile);
}
}
function statusCallback(jobInfo) {
var status = jobInfo.jobStatus;
if(status === "esriJobFailed"){
alert(status);
}
else if (status === "esriJobSucceeded"){
}
}
function downloadFile(outputFile){
map.graphics.clear();
var theurl = outputFile.value.url;
window.location = theurl;
}
After I click the download button on my cart I get an Error message saying:Error: esri.config.defaults.io.proxyUrl is not setI've googled this and looked for help but I'm not sure how to get around this and what causes it.Any ideas?