Select to view content in your preferred language

arcgis-feature-table .layers Property

257
4
Jump to solution
07-29-2025 09:59 AM
D_Atkins
Regular Contributor

Continuing working with the new components, and now onto the Feature-Table -- a mission-critical widget.  

I'm having trouble with the .layers property, in both explicitly setting the array, but more specifically, I can't read any values from the property either.  I have no problem with the feature-table.layer property, so have eliminated most variable references concerns.

We could workaround the issue with .layers, spin up our own 'layer selector' input box and such, but it seems more straightforward to solve our issue with the .layers property if possible.

Ready-made Codepen: FeatureTable .layers Sample

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Esri Frequent Contributor

The `layers` property of the FeatureTable is meant as a settable property by the user.

We can update this documentation to make it more clear of the purpose. It does not auto-populate with layers from the provided map that show in the dropdown. You set it to override what layers that appear in the dropdown.

Here is a demo showing setting and reading `layers` when the table is used by itself.

View solution in original post

0 Kudos
4 Replies
ReneRubalcava
Esri Frequent Contributor

The `layers` property of the FeatureTable is meant as a settable property by the user.

We can update this documentation to make it more clear of the purpose. It does not auto-populate with layers from the provided map that show in the dropdown. You set it to override what layers that appear in the dropdown.

Here is a demo showing setting and reading `layers` when the table is used by itself.

0 Kudos
D_Atkins
Regular Contributor

Probably not as pretty as ESRI's professional demos, but we're happy with the implementation!

Codepen MWE: Feature-Table.layers Property

0 Kudos
LefterisKoumis
Frequent Contributor

@ReneRubalcava It isn’t immediately clear to users that they need to click the stacked layers icon to select which layer to display in the table. As a possible enhancement—and to avoid showing an empty table—you could make it so that clicking the table icon (in the action bar) automatically opens the table with the first visible layer from the map.

For instance, developers could collect all currently displayed layers into an array, and when the table icon is clicked, open the table using layer[0] or whichever layer the developer sets using a table-layer property. 

0 Kudos
D_Atkins
Regular Contributor

Thanks for the clarification; I'll be sure to give that a try!