<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Add simple editing capabilities to existing app in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379068#M35182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good morning, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working with a large Javascript-based app using the 3.2 JS API and ArcGIS 10 map services.&amp;nbsp; We need to add editing capabilities to the app.&amp;nbsp; The editor will be kicked off with a button click, and the user can add points or edit existing points.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where I'm getting stuck, however, is how to implement the editor.&amp;nbsp; My Google-Fu failed to answer my question, and I've reviewed all the editing samples in the documentation. It appears that each sample relies on a large on-screen panel to select graphics types.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All I want users to do is click the map to add a point, and then get the infoWindow pop-up form where they can input data.&amp;nbsp; I do not want any other widgets, toolbars, or templatepickers on-screen. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, I want the point editing capabilities in this sample without the sidebar on the left:&amp;nbsp; &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://developers.arcgis.com/en/javascript/jssamples/ed_default_editingwidget.html" rel="nofollow" target="_blank"&gt;http://developers.arcgis.com/en/javascript/jssamples/ed_default_editingwidget.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone point me in a direction (existing apps, blogs, etc) to help me implement this type of editor, or at least to get started?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Apr 2013 13:31:28 GMT</pubDate>
    <dc:creator>JamesTrier</dc:creator>
    <dc:date>2013-04-12T13:31:28Z</dc:date>
    <item>
      <title>Add simple editing capabilities to existing app</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379068#M35182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good morning, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working with a large Javascript-based app using the 3.2 JS API and ArcGIS 10 map services.&amp;nbsp; We need to add editing capabilities to the app.&amp;nbsp; The editor will be kicked off with a button click, and the user can add points or edit existing points.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where I'm getting stuck, however, is how to implement the editor.&amp;nbsp; My Google-Fu failed to answer my question, and I've reviewed all the editing samples in the documentation. It appears that each sample relies on a large on-screen panel to select graphics types.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All I want users to do is click the map to add a point, and then get the infoWindow pop-up form where they can input data.&amp;nbsp; I do not want any other widgets, toolbars, or templatepickers on-screen. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, I want the point editing capabilities in this sample without the sidebar on the left:&amp;nbsp; &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://developers.arcgis.com/en/javascript/jssamples/ed_default_editingwidget.html" rel="nofollow" target="_blank"&gt;http://developers.arcgis.com/en/javascript/jssamples/ed_default_editingwidget.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone point me in a direction (existing apps, blogs, etc) to help me implement this type of editor, or at least to get started?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 13:31:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379068#M35182</guid>
      <dc:creator>JamesTrier</dc:creator>
      <dc:date>2013-04-12T13:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Add simple editing capabilities to existing app</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379069#M35183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After you click the button to begin editing, you could have an onClick event send a post through REST to add a point feature where the user clicked.&amp;nbsp; You will need to encode the syntax for REST.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function addFeature(evt){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var X = evt.mapPoint.x
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var Y = evt.mapPoint.y
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureService = "http://sever/ArcGIS/rest/services/HSEC/FeatureServer/0/addFeatures?features=";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addPoint = '[{"geometry":{"x":' + X + ',"y":' + Y + '}}]';
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addFeaturesEncode();
}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
function addFeaturesEncode() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var unencoded = addPoint;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var obj = encodeURIComponent(unencoded);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var theUrl = featureService + obj;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var xmlHttp = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlHttp = new XMLHttpRequest();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlHttp.open( "POST", theUrl, false );
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlHttp.send( null );
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Take a look at calling the &lt;/SPAN&gt;&lt;A href="http://developers.arcgis.com/en/javascript/jssamples/ed_attribute_inspector.html" rel="nofollow noopener noreferrer" target="_blank"&gt;attribute inspector&lt;/A&gt;&lt;SPAN&gt; after the point is created to update the attributes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:30:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379069#M35183</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T17:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add simple editing capabilities to existing app</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379070#M35184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@Jake, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the idea and the code sample.&amp;nbsp; I'll give it a test after lunch and let you know how it works out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just curious, any thoughts or ideas on why that functionality doesn't have an out-of-the-box solution in the API?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 15:15:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379070#M35184</guid>
      <dc:creator>JamesTrier</dc:creator>
      <dc:date>2013-04-12T15:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add simple editing capabilities to existing app</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379071#M35185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried using the sample code above, as well as dojo.xhrPost and dojo.xhrGet.&amp;nbsp; I cannot get the feature layer to accept a point this way.&amp;nbsp; I get two errors - one says 405 (Method not allowed) and the other says my address "is not allowed by Access-Control-Allow-Origin".&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure why I'd get a CORS error with a POST, as I don't get this error when POSTing to other internal servers.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 17:02:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379071#M35185</guid>
      <dc:creator>JamesTrier</dc:creator>
      <dc:date>2013-04-12T17:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add simple editing capabilities to existing app</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379072#M35186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The service you are posting to may have REST configured to &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/rest/apiref/" rel="nofollow" target="_blank"&gt;restrict access&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; While additional server side configuration is required to use CORS with a&amp;nbsp; 9.3 or 10.0 ArcGIS Server instance, 10.1 instances of ArcGIS Server&amp;nbsp; will support CORS out of the box.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try using the following service:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/PhoneIncidents/FeatureServer/0" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/PhoneIncidents/FeatureServer/0&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 17:36:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379072#M35186</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-04-12T17:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Add simple editing capabilities to existing app</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379073#M35187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I marked the last answer as the solution because it looks like changing the CORS settings would get the code above working just fine.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ultimately, we decided to not fight the API and will work with the Editor widget after all.&amp;nbsp; I already have the widget configured with our map services.&amp;nbsp; We'll use it to vary the types of points a user can add to the service. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 18:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379073#M35187</guid>
      <dc:creator>JamesTrier</dc:creator>
      <dc:date>2013-04-12T18:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add simple editing capabilities to existing app</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379074#M35188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can do this with the api you just need to handle many of the update events yourself. The feature layer has an applyEdits method that can be used to add, update and delete features. Here's code for a simple use case where we are editing a point feature layer with only one feature template. In this app just click the 'Add Note' button and you'll see a new note added to the map and the attribute inspector will appear. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;nbsp; &amp;lt;title&amp;gt;Simple Editing&amp;lt;/title&amp;gt;
&amp;nbsp; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
&amp;nbsp; &amp;lt;link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css"&amp;gt;
&amp;nbsp; &amp;lt;link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css"&amp;gt;
&amp;nbsp; &amp;lt;link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css"&amp;gt;
&amp;nbsp; &amp;lt;style&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; html,body,#mapDiv,.map.container{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padding:0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; margin:0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height:100%;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; #point{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z-index: 40;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; position: absolute;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; top:30px;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right:40px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; &amp;lt;/style&amp;gt;
&amp;nbsp; 
&amp;nbsp; &amp;lt;script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/"&amp;gt;&amp;lt;/script&amp;gt;
&amp;nbsp; &amp;lt;script&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.map");
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.layers.FeatureLayer");
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.dijit.AttributeInspector-all");
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("esri.toolbars.draw");
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var drawToolbar, map;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var notesLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var attributeInspector;

&amp;nbsp;&amp;nbsp;&amp;nbsp; function init(){

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(dojo.byId("point"), "onclick", function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //activate the draw toolbar so a new point can be added to the map 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar.activate(esri.toolbars.Draw.POINT);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.config.defaults.io.proxyUrl = "http://localhost/~kell3008/proxy/proxy.php";

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map = new esri.Map("mapDiv", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: [-56.049, 38.485],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoom: 3,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; basemap: "streets"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notesLayer&amp;nbsp; = new esri.layers.FeatureLayer("http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/Notes/FeatureServer/0",{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ["*"]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //select features and show attribute inspector when clicking on note feature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(notesLayer,"onClick", showAttributes);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(map, "onLayersAddResult", setupEditor);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayers([notesLayer]);




&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; function showAttributes(event){ 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hideAttributes();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query&amp;nbsp; = new esri.tasks.Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.objectIds = [event.graphic.attributes.objectid];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notesLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function(features){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //attributeInspector.refresh();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.show(event.screenPoint);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; function hideAttributes(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(map.infoWindow.isShowing){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.hide();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; function setupEditor(results){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //setup the draw toolbar and an event that will fire after the point has been drawn.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar = new esri.toolbars.Draw(map);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(drawToolbar, "onDrawEnd",addNote);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create the attribute inspector so we can update attributes
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //first lets get the feature layers to associate with the attribute inspector
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var layerInfos = dojo.map(results, function(result) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'featureLayer':result.layer,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'showAttachments': false
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attributeInspector = new esri.dijit.AttributeInspector({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfos: layerInfos,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },dojo.create("div"));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //display the attribute inspector in the popup 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.setTitle("Edit Features");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.setContent(attributeInspector.domNode);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(attributeInspector, "onAttributeChange", updateAttributes);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(attributeInspector, "onDelete", deleteFeature);



&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; function updateAttributes(feature, fieldName, newFieldValue){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //update attributes for feature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.attributes[fieldName] = newFieldValue;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notesLayer.applyEdits(null, [feature]); 

&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; function deleteFeature(feature){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //remove the feature from the feature layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notesLayer.applyEdits(null, null, [feature]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hideAttributes();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; function addNote(geometry){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add a new feature to the feature layer 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar.deactivate();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //only one feature template in this feature layer so let's get that one and use it
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //the template gets us access to things like the attribute info so we can populate
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //the new feature with the default attributes. 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var template = notesLayer.templates[0];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //lets setup the attributes for the new feature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var attributes = dojo.mixin({},template.prototype.attributes);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //now create the feature and add it to the layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var feature = new esri.Graphic(geometry ,null, attributes);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; notesLayer.applyEdits([feature]);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.show(map.toScreen(geometry));

&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.ready(init);
&amp;nbsp; &amp;lt;/script&amp;gt;

&amp;lt;/head&amp;gt;
&amp;lt;body class="claro"&amp;gt;
&amp;nbsp; &amp;lt;div id="mapDiv"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="point" type="button" value="Add Note"/&amp;gt;
&amp;nbsp; &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:30:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379074#M35188</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2021-12-11T17:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add simple editing capabilities to existing app</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379075#M35189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;James &lt;BR /&gt;&lt;BR /&gt;You can do this with the api you just need to handle many of the update events yourself. The feature layer has an applyEdits method that can be used to add, update and delete features. Here's code for a simple use case where we are editing a point feature layer with only one feature template. In this app just click the 'Add Note' button and you'll see a new note added to the map and the attribute inspector will appear. &lt;BR /&gt;&lt;BR /&gt;&amp;lt;snip&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kelly, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is also very helpful, I think this will come in handy!&amp;nbsp; Thank you both for your assistance!&amp;nbsp; Enjoy the weekend!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 18:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379075#M35189</guid>
      <dc:creator>JamesTrier</dc:creator>
      <dc:date>2013-04-12T18:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Add simple editing capabilities to existing app</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379076#M35190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;You can do this with the api you just need to handle many of the update events yourself. The feature layer has an applyEdits method that can be used to add, update and delete features. Here's code for a simple use case where we are editing a point feature layer with only one feature template. In this app just click the 'Add Note' button and you'll see a new note added to the map and the attribute inspector will appear. &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey Kelly,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Couldn't seem to get your code example to work in JSFiddle. Could update an existing point, but not add a new point and update it's attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a similar need for an ongoing project. Thoughts? Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fidde &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/dmiller/YNb4y/"&gt;http://jsfiddle.net/dmiller/YNb4y/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 22:06:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-simple-editing-capabilities-to-existing-app/m-p/379076#M35190</guid>
      <dc:creator>DerekMiller</dc:creator>
      <dc:date>2013-07-31T22:06:02Z</dc:date>
    </item>
  </channel>
</rss>

