The AttributeTable component displays a tabular view of a feature layer's attributes. If the feature layer is editable, you can edit the records within the table widget as well. It recognizes layers added specifically as feature layers, whether it be from a Feature Service or Dynamic Map Service. In addition to feature layers that are directly added, it will also recognize any layers within a full dynamic map service as well and display features within the extent.
Working with the AttributeTable
Once the web application loads, the AttributeTable component checks for any feature layer feature(s) in the current extent and populates the attribute table with its feature(s). Aside from providing a tabular display of the layer's data, the feature's can be selected, deselected, and zoomed-to by interacting with the attribute table. If these feature layers are editable, the corresponding feature attributes will also be editable. In addition, the fields can be sorted by clicking on its heading.
The attribute table also has a Table Options dropdown combobox that allows you to choose different functions such as:
- Export the attributes to a CSV file—Exports the attributes to a separate CSV file.
If records are selected, only the selected features are written to this file. If working with point feature classes, two additional fields are also written into this CSV file indicating latitude and longitude. This specific feature with points is only supported for Web Mercator and Geographic spatial references.
- Zoom to selected features—Zooms to the extent of the selected features.
- Clear Selection—Clears the current selection.
- Delete selected features —If editable, deletes the selected features.
This option is only enabled if the feature layer is editable.
- Show attachments—This option is available if the feature layer has attachments enabled on it.
- Show related records—This option is available if the feature layer has any associated relationships.
If a Uniform Resource Locator (URL) exists as a field value in your service it will display as a text string in the attribute table and not as a hyperlink.
If you are outside an extent and are not displaying any visible features, a message will appear displaying "No features in current map extent". Also, if your scale is out of the visible range of the layer, you will receive a message stating "Layer is out of scale range".
Requires: Feature layers from either a dynamic map service or feature service.
- Reads feature layers and populates the contents of the widget with the corresponding feature's records within the current map extent. If more than one layer, multiple tabs will display in the table.
- Attribute table updates as feature(s) updates change with extent changes.
- Interactive functionality between records and features in the map.
- Edits can be performed on the records if the layer is editable.
To test out this functionality, see the AttributeTable sample.