<?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 How to update the fieldInfos of the Attribute Editor dynamically in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-update-the-fieldinfos-of-the-attribute/m-p/662897#M61859</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I am using Editor Widget for editing a feature service.I need to dynamically change the fieldInofs of the Attribute Inspector inside it based on the feature type clicking.After updating the fieldInofs on the click event,when I click the particular feature type for the first time the new fieldInfo is getting updated but when I click another feature type the attribute inspector is not getting updated with the new fieldInfo.Can anyone help me in this regard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Below I am furnishing the code snippet:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;var fieldInfos1 = [&lt;BR /&gt; &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ 'fieldName': 'sector', 'label': 'sector', 'isEditable': true } &lt;BR /&gt;&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;/P&gt;&lt;P&gt;var fieldInfos2 = [ &lt;BR /&gt;&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; { 'fieldName': 'sector', 'label': 'sector', 'isEditable': true },&lt;BR /&gt;&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; { 'fieldName': 'assessment', 'label': 'assessment', 'isEditable': true }&lt;BR /&gt;&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;responsePointsFL.on("click", function (evt) {&lt;BR /&gt; if (evt.graphic.attributes["activity_t"] == "Aircraft Enemy") {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var sectorField = responsePoints.fields[5];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fieldInfos1[0].field = sectorField;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myEditor.settings.layerInfos[0].fieldInfos = [];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myEditor.settings.layerInfos[0].fieldInfos=fieldInfos1;&lt;BR /&gt; }&lt;BR /&gt; else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var sectorField = responsePoints.fields[5];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var asssesmentField = responsePoints.fields[6];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fieldInfos2[0].field = sectorField;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fieldInfos2[1].field = asssesmentField;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myEditor.settings.layerInfos[0].fieldInfos = [];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myEditor.settings.layerInfos[0].fieldInfos = fieldInfos2;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kishore Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Sep 2016 06:03:05 GMT</pubDate>
    <dc:creator>kishorekumar1</dc:creator>
    <dc:date>2016-09-27T06:03:05Z</dc:date>
    <item>
      <title>How to update the fieldInfos of the Attribute Editor dynamically</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-update-the-fieldinfos-of-the-attribute/m-p/662897#M61859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I am using Editor Widget for editing a feature service.I need to dynamically change the fieldInofs of the Attribute Inspector inside it based on the feature type clicking.After updating the fieldInofs on the click event,when I click the particular feature type for the first time the new fieldInfo is getting updated but when I click another feature type the attribute inspector is not getting updated with the new fieldInfo.Can anyone help me in this regard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Below I am furnishing the code snippet:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;var fieldInfos1 = [&lt;BR /&gt; &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ 'fieldName': 'sector', 'label': 'sector', 'isEditable': true } &lt;BR /&gt;&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;/P&gt;&lt;P&gt;var fieldInfos2 = [ &lt;BR /&gt;&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; { 'fieldName': 'sector', 'label': 'sector', 'isEditable': true },&lt;BR /&gt;&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; { 'fieldName': 'assessment', 'label': 'assessment', 'isEditable': true }&lt;BR /&gt;&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;responsePointsFL.on("click", function (evt) {&lt;BR /&gt; if (evt.graphic.attributes["activity_t"] == "Aircraft Enemy") {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var sectorField = responsePoints.fields[5];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fieldInfos1[0].field = sectorField;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myEditor.settings.layerInfos[0].fieldInfos = [];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myEditor.settings.layerInfos[0].fieldInfos=fieldInfos1;&lt;BR /&gt; }&lt;BR /&gt; else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var sectorField = responsePoints.fields[5];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var asssesmentField = responsePoints.fields[6];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fieldInfos2[0].field = sectorField;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fieldInfos2[1].field = asssesmentField;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myEditor.settings.layerInfos[0].fieldInfos = [];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myEditor.settings.layerInfos[0].fieldInfos = fieldInfos2;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kishore Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2016 06:03:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-update-the-fieldinfos-of-the-attribute/m-p/662897#M61859</guid>
      <dc:creator>kishorekumar1</dc:creator>
      <dc:date>2016-09-27T06:03:05Z</dc:date>
    </item>
  </channel>
</rss>

