<?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: Feature Table and Selection on Map in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466075#M43134</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That helped a ton already, the table appears now and the selection works, now it should just be getting the two to sync up. &amp;nbsp;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Oct 2016 18:16:42 GMT</pubDate>
    <dc:creator>LindaDunklee</dc:creator>
    <dc:date>2016-10-13T18:16:42Z</dc:date>
    <item>
      <title>Feature Table and Selection on Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466073#M43132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I started with this code doing a lot of other things and now I'm having a hard time getting the feature table and the rest of the app to cooperate. &amp;nbsp;Would anyone have any suggestions on how to tweak this to make selections in the feature table translate to the map, and vice versa? &amp;nbsp;The version I'm including the feature table doesn't appear where it should. &amp;nbsp;Taking the selection out makes the feature table appear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A note, all of the data sources mentioned are the same. &amp;nbsp;I'm sure this is part of the issue but can't quite wrap my head around how to clean up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var acc = document.getElementsByClassName("accordion");&lt;BR /&gt;var i;&lt;/P&gt;&lt;P&gt;for (i = 0; i &amp;lt; acc.length; i++) {&lt;BR /&gt; acc&lt;I&gt;.onclick = function(){&lt;BR /&gt; this.classList.toggle("active");&lt;BR /&gt; this.nextElementSibling.classList.toggle("show");&lt;BR /&gt; }&lt;BR /&gt;}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;require([&lt;BR /&gt; "dojo/dom", "dojo/on",&lt;BR /&gt; "esri/map",&lt;BR /&gt; "dojo/parser",&lt;BR /&gt; "esri/layers/FeatureLayer",&lt;BR /&gt; "esri/dijit/FeatureTable",&lt;BR /&gt; "esri/symbols/SimpleMarkerSymbol",&lt;BR /&gt; "esri/symbols/SimpleLineSymbol",&lt;BR /&gt; "esri/Color",&lt;BR /&gt; "esri/graphicsUtils",&lt;BR /&gt; "esri/tasks/query", &lt;BR /&gt; "esri/tasks/QueryTask", &lt;BR /&gt; "dojo/ready",&lt;BR /&gt; "dojo/domReady!"&lt;BR /&gt;], function(dom, on, Map, parser,FeatureLayer, graphicsUtils, SimpleMarkerSymbol, SimpleLineSymbol, Color, FeatureTable,&lt;BR /&gt; Query, &lt;BR /&gt; QueryTask,&lt;BR /&gt; ready&lt;BR /&gt; ) {&lt;BR /&gt; &lt;BR /&gt; parser.parse();&lt;BR /&gt; &lt;BR /&gt; ready(function(){&lt;/P&gt;&lt;P&gt;// Create the feature layer&lt;BR /&gt; var myFeatureLayer = new FeatureLayer("*datasourcehere*", {&lt;BR /&gt; mode: FeatureLayer.MODE_ONDEMAND,&lt;BR /&gt; outFields: ["*"],&lt;BR /&gt; visible: true,&lt;BR /&gt; id: "fLayer"&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; var selectionSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 7,&lt;BR /&gt; new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 255, 197, 1])));&lt;/P&gt;&lt;P&gt;myFeatureLayer.setSelectionSymbol(selectionSymbol);&lt;BR /&gt; &lt;BR /&gt; myFeatureLayer.on("click", function(evt) {&lt;BR /&gt; var idProperty = myFeatureLayer.objectIdField,&lt;BR /&gt; feature,&lt;BR /&gt; featureId,&lt;BR /&gt; query;&lt;BR /&gt; &lt;BR /&gt; if (evt.graphic &amp;amp;&amp;amp; evt.graphic.attributes &amp;amp;&amp;amp; evt.graphic.attributes[idProperty]) {&lt;BR /&gt; feature = evt.graphic,&lt;BR /&gt; featureId = feature.attributes[idProperty];&lt;BR /&gt; &lt;BR /&gt; query = new Query();&lt;BR /&gt; query.returnGeometry = false;&lt;BR /&gt; query.objectIds = [featureId];&lt;BR /&gt; query.where = "1=1";&lt;BR /&gt; &lt;BR /&gt; myFeatureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW);&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; map.addLayer(myFeatureLayer);&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; myTable = new FeatureTable({&lt;BR /&gt; featureLayer : myFeatureLayer,&lt;BR /&gt; showGridMenu: false,&lt;BR /&gt; hiddenFields: [] // field that end-user can show, but is hidden on startup&lt;BR /&gt; }, "myTableNode");&lt;/P&gt;&lt;P&gt;myTable.startup();&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; });&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;var queryTask = new QueryTask("*datasourcehere*");&lt;/P&gt;&lt;P&gt;var query = new Query();&lt;BR /&gt; query.returnGeometry = false;&lt;BR /&gt; query.outFields = ["*"&lt;BR /&gt; ];&lt;/P&gt;&lt;P&gt;on(dom.byId("execute"), "click", execute);&lt;BR /&gt; on(dom.byId("SitesCheck"), "click", changecheck);&lt;BR /&gt; &lt;BR /&gt; map = new Map("map", {&lt;BR /&gt; center: [-94.560647,39.121954],&lt;BR /&gt; zoom: 7,&lt;BR /&gt; basemap: "dark-gray"&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; var featureLayer = new FeatureLayer("*datasourcehere");&lt;/P&gt;&lt;P&gt;map.addLayer(featureLayer);&lt;BR /&gt; &lt;BR /&gt; function changecheck(){&lt;BR /&gt; if (dom.byId("SitesCheck").checked) {&lt;BR /&gt; featureLayer.show();&lt;BR /&gt; } else {&lt;BR /&gt; featureLayer.hide();&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function execute() {&lt;BR /&gt; query.where = "Site_ID LIKE '%" + dom.byId("stateName").value + "%'";&lt;BR /&gt; queryTask.execute(query, showResults);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function showResults(results) {&lt;BR /&gt; var resultItems = [];&lt;BR /&gt; var resultCount = results.features.length;&lt;BR /&gt; for (var i = 0; i &amp;lt; resultCount; i++) {&lt;BR /&gt; var featureAttributes = results.features&lt;I&gt;.attributes;&lt;BR /&gt; var activity_id = results.features&lt;I&gt;.attributes.Activity_ID;&lt;BR /&gt; var activity_status = results.features&lt;I&gt;.attributes.Activity_Status;&lt;BR /&gt; var code = results.features&lt;I&gt;.attributes.Code;&lt;BR /&gt; var activity_name = results.features&lt;I&gt;.attributes.Activity_Name;&lt;BR /&gt; var latitude = results.features&lt;I&gt;.attributes.Lat;&lt;BR /&gt; var longitude = results.features&lt;I&gt;.attributes.Long;&lt;BR /&gt; var status = results.features&lt;I&gt;.attributes.Status;&lt;BR /&gt; var pdf = results.features&lt;I&gt;.attributes.PDF_LINKS;&lt;BR /&gt; for (var attr in featureAttributes) {&lt;BR /&gt; resultItems.push(&lt;BR /&gt; "&amp;lt;b&amp;gt;" + attr + ":&amp;lt;/b&amp;gt; " + featureAttributes[attr]);&lt;BR /&gt; }&lt;BR /&gt; resultItems.push("&amp;lt;br&amp;gt;");&lt;BR /&gt; }&lt;BR /&gt; dom.byId("activityID").innerHTML = activity_id;&lt;BR /&gt; dom.byId("activitystatus").innerHTML = activity_status;&lt;BR /&gt; dom.byId("code").innerHTML = code;&lt;BR /&gt; dom.byId("activityname").innerHTML = activity_name;&lt;BR /&gt; dom.byId("status").innerHTML = status;&lt;BR /&gt; dom.byId("pdfwindow").src = pdf;&lt;BR /&gt; dom.byId("video").src = ""&lt;BR /&gt; initialize(latitude, longitude);&lt;BR /&gt; dom.byId("calendar").style.visibility = "visible";&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt;});&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var panorama;&lt;BR /&gt;function initialize(latitude, longitude) {&lt;BR /&gt; panorama = new google.maps.StreetViewPanorama(&lt;BR /&gt; document.getElementById('streetviewpane'),&lt;BR /&gt; {&lt;BR /&gt; position: {lat: latitude, lng: longitude},&lt;BR /&gt; pov: {heading: 165, pitch: 0},&lt;BR /&gt; zoom: 1&lt;BR /&gt; });&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 17:59:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466073#M43132</guid>
      <dc:creator>LindaDunklee</dc:creator>
      <dc:date>2016-10-13T17:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Table and Selection on Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466074#M43133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first thing that you need to fix is that the function arguments don't agree with the modules loaded in the require. These have to be in the same order!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:01:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466074#M43133</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2016-10-13T18:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Table and Selection on Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466075#M43134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That helped a ton already, the table appears now and the selection works, now it should just be getting the two to sync up. &amp;nbsp;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:16:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466075#M43134</guid>
      <dc:creator>LindaDunklee</dc:creator>
      <dc:date>2016-10-13T18:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Table and Selection on Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466076#M43135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's the difference between the two FeatureLayers you're adding to the map, myFeatureLayer and featureLayer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:32:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466076#M43135</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2016-10-13T18:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Table and Selection on Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466077#M43136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There isn't - that's part of what I'm hoping I can consolidate - it's poorly written. &amp;nbsp;That came about from trying to get a query to work, then trying to get a feature table to work, and not being able to get them to work together.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:37:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-and-selection-on-map/m-p/466077#M43136</guid>
      <dc:creator>LindaDunklee</dc:creator>
      <dc:date>2016-10-13T18:37:38Z</dc:date>
    </item>
  </channel>
</rss>

