<?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 Re: Possible to edit attribute with a click? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-to-edit-attribute-with-a-click/m-p/135902#M12631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was able to edit attributes with a click by adding this code under the onClick event, but it only works for one layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; operationalLineLayer.selectFeatures(selectQuery, esri.layers.FeatureLayer.SELECTION_NEW, function(features) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (features[0].attributes["STATUS2013"] == 'Not Complete') { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //store the current feature &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; updateFeature = features[0]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateFeature.attributes["STATUS2013"] = 'Complete'; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateFeature.getLayer().applyEdits(null, [updateFeature], null);&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; else (features[0].attributes["STATUS2013"] == 'Complete') { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //store the current feature &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; updateFeature = features[0]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateFeature.attributes["STATUS2013"] = 'Not Complete'; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateFeature.getLayer().applyEdits(null, [updateFeature], null);&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; else { &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; 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; } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code only works for my line layer. I am unsure how to run the same selection code for my point and area layers. When I try to copy the code with the other layer names into the onClick event, it only works on the first layer. Not sure how to make all three layers on the map selectable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To see the test website in action, with only the selection working for the line layer, here is the link: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://maps.peterborough.ca/trafficlines/editwin4.html" rel="nofollow" target="_blank"&gt;http://maps.peterborough.ca/trafficlines/editwin4.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Charmalee&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Apr 2013 23:09:26 GMT</pubDate>
    <dc:creator>CharmaleeSandanayake</dc:creator>
    <dc:date>2013-04-16T23:09:26Z</dc:date>
    <item>
      <title>Possible to edit attribute with a click?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-to-edit-attribute-with-a-click/m-p/135901#M12630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am new to Javascript and I am creating a simple web application to edit the status of road line paint through an iPad JavaScript website. As the city's Public Works field crew completes the line painting job, they would be able to click on and change the status field of each line paint shape to 'Complete' through their iPad.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been able to modify the following sample to fit my data: 'Attribute Inspector with one editable field' &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/widget_attributeinspectorpane.html" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/widget_attributeinspectorpane.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found that on the iPad it is cumbersome to click on a feature and then again on the dropdown to modify the feature's attributes. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to modify the code so that as soon as the feature is clicked, the status of the line paint layer changes to 'Complete'? A second click on the shape would change the status field back to 'Not Complete'. This way there is no need to go through the dropdown.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another alternative is having a Complete and Not Complete button. When I select a feature, instead of having a dropdown could I add a button to change the attribute?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code I have so far is attached and available on this test website too: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://maps.peterborough.ca/trafficlines/editat.html" rel="nofollow" target="_blank"&gt;http://maps.peterborough.ca/trafficlines/editat.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help or input would be appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 22:33:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-to-edit-attribute-with-a-click/m-p/135901#M12630</guid>
      <dc:creator>CharmaleeSandanayake</dc:creator>
      <dc:date>2013-04-02T22:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to edit attribute with a click?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-to-edit-attribute-with-a-click/m-p/135902#M12631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was able to edit attributes with a click by adding this code under the onClick event, but it only works for one layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; operationalLineLayer.selectFeatures(selectQuery, esri.layers.FeatureLayer.SELECTION_NEW, function(features) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (features[0].attributes["STATUS2013"] == 'Not Complete') { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //store the current feature &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; updateFeature = features[0]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateFeature.attributes["STATUS2013"] = 'Complete'; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateFeature.getLayer().applyEdits(null, [updateFeature], null);&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; else (features[0].attributes["STATUS2013"] == 'Complete') { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //store the current feature &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; updateFeature = features[0]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateFeature.attributes["STATUS2013"] = 'Not Complete'; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateFeature.getLayer().applyEdits(null, [updateFeature], null);&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; else { &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; 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; } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code only works for my line layer. I am unsure how to run the same selection code for my point and area layers. When I try to copy the code with the other layer names into the onClick event, it only works on the first layer. Not sure how to make all three layers on the map selectable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To see the test website in action, with only the selection working for the line layer, here is the link: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://maps.peterborough.ca/trafficlines/editwin4.html" rel="nofollow" target="_blank"&gt;http://maps.peterborough.ca/trafficlines/editwin4.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Charmalee&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 23:09:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/possible-to-edit-attribute-with-a-click/m-p/135902#M12631</guid>
      <dc:creator>CharmaleeSandanayake</dc:creator>
      <dc:date>2013-04-16T23:09:26Z</dc:date>
    </item>
  </channel>
</rss>

