<?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 Implementing Feature Table Interaction in React ESRI Map Component in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/implementing-feature-table-interaction-in-react/m-p/1419793#M82880</link>
    <description>&lt;P&gt;I'm currently developing a React application utilizing ESRI's ArcGIS API for JavaScript to display maps and interact with feature layers. Here's a simplified version of my component:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { Box } from '@mui/material'
import React, { useEffect } from 'react'
import { loadModules } from 'esri-loader'

 

export default function Home() {
  useEffect(() =&amp;gt; {
    loadModules(['esri/WebMap', 'esri/views/MapView','esri/layers/FeatureLayer',
    'esri/widgets/FeatureTable',], { css: true })
      .then(([WebMap, MapView,FeatureLayer, FeatureTable,]) =&amp;gt; {
        let webmap = new WebMap({
          portalItem: {
            id: '' //webmap id
          }
        })

 

        let view = new MapView({
          container: 'viewDiv',
          map: webmap
        })

 

        view.when(() =&amp;gt; {
          const featureLayer = new FeatureLayer({
            portalItem: {
              id: '' //feature layer id
            },
            outFields: ['*'],
            title: 'Customer'
          })

 

          webmap.add(featureLayer)

 

          const featureTable = new FeatureTable({
            view: view,
            layer: featureLayer,
            multiSortEnabled: true,
            editingEnabled: true,
            tableTemplate: {
              columnTemplates: [
                // Column template configurations
              ]
            },
            container: 'tableDiv'
          })

 

          view.ui.add(featureTable, 'bottom')
        })
      })
      .catch(error =&amp;gt; {
        console.error('Error loading modules:', error)
      })
  }, [])

 

  return (
&amp;lt;Box&amp;gt;
&amp;lt;Box id='viewDiv' sx={{ flex: '1', width: '100%' }}&amp;gt;&amp;lt;/Box&amp;gt;
&amp;lt;Box id='tableDiv' sx={{ flex: '1', width: '100%' }}&amp;gt;&amp;lt;/Box&amp;gt;
&amp;lt;/Box&amp;gt;
  )
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;Question Context:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I've successfully integrated the map and feature layers into my React component. However, I'm facing challenges implementing a feature where users can interact with popups and view corresponding data in a feature table. Here are my specific questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Popup Interaction: How can I configure the component so that when a user clicks on a popup, they're presented with an option to view the associated data in the feature table? I aim to display all relevant data, typically 1 of 4 records, when the "Show on Map" button within the popup is clicked.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Data Retrieval: I've explored various examples provided by ESRI, but I'm unsure how to retrieve the necessary data for the feature table. Some examples use URLs, while others utilize webmap.layers.getItemAt(0) &amp;nbsp;OR const featureLayer = webmap.findLayerById("OverlaySchools_2862");. &amp;nbsp;Could you provide guidance on how to access and display the data effectively?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;Custom API Integration: My application contains additional data that isn't represented on the map but needs to be displayed in the feature table. How can I incorporate this custom data, possibly through API calls, within the feature table?&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;P&gt;I appreciate any insights or assistance you can provide in addressing these challenges. Thank you!&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
    <pubDate>Tue, 07 May 2024 10:13:47 GMT</pubDate>
    <dc:creator>koushikE</dc:creator>
    <dc:date>2024-05-07T10:13:47Z</dc:date>
    <item>
      <title>Implementing Feature Table Interaction in React ESRI Map Component</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/implementing-feature-table-interaction-in-react/m-p/1419793#M82880</link>
      <description>&lt;P&gt;I'm currently developing a React application utilizing ESRI's ArcGIS API for JavaScript to display maps and interact with feature layers. Here's a simplified version of my component:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { Box } from '@mui/material'
import React, { useEffect } from 'react'
import { loadModules } from 'esri-loader'

 

export default function Home() {
  useEffect(() =&amp;gt; {
    loadModules(['esri/WebMap', 'esri/views/MapView','esri/layers/FeatureLayer',
    'esri/widgets/FeatureTable',], { css: true })
      .then(([WebMap, MapView,FeatureLayer, FeatureTable,]) =&amp;gt; {
        let webmap = new WebMap({
          portalItem: {
            id: '' //webmap id
          }
        })

 

        let view = new MapView({
          container: 'viewDiv',
          map: webmap
        })

 

        view.when(() =&amp;gt; {
          const featureLayer = new FeatureLayer({
            portalItem: {
              id: '' //feature layer id
            },
            outFields: ['*'],
            title: 'Customer'
          })

 

          webmap.add(featureLayer)

 

          const featureTable = new FeatureTable({
            view: view,
            layer: featureLayer,
            multiSortEnabled: true,
            editingEnabled: true,
            tableTemplate: {
              columnTemplates: [
                // Column template configurations
              ]
            },
            container: 'tableDiv'
          })

 

          view.ui.add(featureTable, 'bottom')
        })
      })
      .catch(error =&amp;gt; {
        console.error('Error loading modules:', error)
      })
  }, [])

 

  return (
&amp;lt;Box&amp;gt;
&amp;lt;Box id='viewDiv' sx={{ flex: '1', width: '100%' }}&amp;gt;&amp;lt;/Box&amp;gt;
&amp;lt;Box id='tableDiv' sx={{ flex: '1', width: '100%' }}&amp;gt;&amp;lt;/Box&amp;gt;
&amp;lt;/Box&amp;gt;
  )
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;Question Context:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I've successfully integrated the map and feature layers into my React component. However, I'm facing challenges implementing a feature where users can interact with popups and view corresponding data in a feature table. Here are my specific questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Popup Interaction: How can I configure the component so that when a user clicks on a popup, they're presented with an option to view the associated data in the feature table? I aim to display all relevant data, typically 1 of 4 records, when the "Show on Map" button within the popup is clicked.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Data Retrieval: I've explored various examples provided by ESRI, but I'm unsure how to retrieve the necessary data for the feature table. Some examples use URLs, while others utilize webmap.layers.getItemAt(0) &amp;nbsp;OR const featureLayer = webmap.findLayerById("OverlaySchools_2862");. &amp;nbsp;Could you provide guidance on how to access and display the data effectively?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;Custom API Integration: My application contains additional data that isn't represented on the map but needs to be displayed in the feature table. How can I incorporate this custom data, possibly through API calls, within the feature table?&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;P&gt;I appreciate any insights or assistance you can provide in addressing these challenges. Thank you!&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 07 May 2024 10:13:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/implementing-feature-table-interaction-in-react/m-p/1419793#M82880</guid>
      <dc:creator>koushikE</dc:creator>
      <dc:date>2024-05-07T10:13:47Z</dc:date>
    </item>
  </channel>
</rss>

