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
Solved! Go to Solution.
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.
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.
Probably not as pretty as ESRI's professional demos, but we're happy with the implementation!
Codepen MWE: Feature-Table.layers Property
@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.