Defining Custom JavaScript

The ESRI Configuration Utility allows you to write your own JavaScript syntax that can be referenced by the XML definition file. You can also specify whether the custom JavaScript syntax should be used with maps and/or reports by selecting the corresponding check boxes.

The following image shows the XML definition file (esriconfig_new.xml) being edited in the ESRI Configuration Utility. The esriconfig_new.xml file is used by the Retail Predictives sample application. In this image, the Javascript tab is selected.

The Retail Predictives sample application uses the following custom JavaScript syntax:

function RunMyMapOutput(strParms,value,fexId)
   {    	
   		//debugger;
   		objParms = getArgsObjectFromString(strParms,value);
   		
   		//alert (strParms);
		var getMapViewerWindow = window.top.frames["mapWindowLEAflex"];
		getMapViewerWindow.jsClearMap(null,null,true,true);
		getMapViewerWindow.jsRunFex(fexId,false,objParms);
		getMapViewerWindow.focus();
   }
function getArgsObjectFromString(strParms,value)
	{
		var args = new Object();
		args[strParms] = value;       
		return args;
	}

WebFOCUS