Select to view content in your preferred language

Feature Table Widget

185
2
10-09-2024 02:35 PM
BernardAbubakari
New Contributor

I'm looking to integrate the attribute table of a layer into a webpage, but I've encountered an issue with the FeatureTable widget. It appears to create a standalone table by placing it in a container in the DOM, rather than allowing me to embed it directly in the expand widget

My goal is to use the Expand widget so that when I click on it, the attribute table opens. However, despite several attempts, the table consistently opens in the container (div container) instead of within the Expand widget.

Your help would be greatly appreciated!

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor

When adding code to your question, please use the "Insert/edit code sample" button. Reading code in an image (especially as an attachment) is much more difficult.

You're setting the container to "tableDiv", which I'm guessing is the div below the map as in this sample. Normally, you could add it into its own container, such as in the Expand sample. However, in my initial testing, this is only adding the table title to the Expand widget, so I'm not sure if this is possible or not.

 

featureTable = new FeatureTable({
  view: view, // Required for feature highlight to work
  layer: featureLayer,
  header: false,
  visibleElements: {
    menuItems: meuItems
  },
  tableTemplate: template,
  //container: document.getElementById("tableDiv")
  container: document.createElement("div")
});

Snag_60e28d.png

 

0 Kudos
BernardAbubakari
New Contributor

Thanks for letting me know the  "Insert/edit code sample"

Yes, that is the same results I am getting. I only get the title of the table when I click on the expand widget. The Expand widget and BasemapGallery widget works pretty well but the Expand and the FeatureTable widget is not.

0 Kudos