I'm building a custom widget and am trying to add a layer to the Attributes Table. I believe my layer is successfully being added to the Attributes Table as I can see the column headers change for the layer when added. My issue is that I'm not seeing any data from my layer show-up in the Attributes Table.
Where does the Attribute Table pull the data from for a layer?
Below is a sample of how I am creating the FeatureLayer that will be added to the table:
</CODE></P><PRE class="lia-code-sample line-numbers language-none"> const polyline = new Polyline(polylineJson);
var routeInfoTemplate = new InfoTemplate('Route Name:' + route.attributes.Name);
var routeAttributes = {
RouteName: route.attributes.Name,
OrderCount: route.attributes.OrderCount,
};
const polylineGraphic = new context.esriJS.Graphic({
'geometry': polyline,
'symbol': { "color": colorArr<I>, "width": 1, "type": "esriSLS", "style": "esriSLSSolid" },
'attributes': routeAttributes,
'infoTemplate': routeInfoTemplate
});
<CODE>
var layerDefinition = {
"name": "SHA Test " + route.attributes.Name,
"geometryType": "esriGeometryPolyline",
"fields": [{
"name": "Name",
"alias": "RouteName",
"type": "esriFieldTypeString"
}, {
"name": "OrderCount",
"alias": "Order Count",
"type": "esriFieldTypeString"
}]
}