Add refresh method to FeatureTable

501
1
12-08-2015 09:10 AM
Status: Open
SteveCole
Frequent Contributor
The FeatureTable dijit in the Javascript API currently has no method for refreshing its data source. This is needed if the data layer it links to has changed, either by editing, or the application of a definition expression. I think the only way to do this currently is to destory the dijit, and re-create it.

In my current application, I am showing various locations of damage caused by natural disasters. Each location has a date associated with that disaster event. My interface has a combo box where the user can select a specific disaster event date and then the map is filtered to only show these locations. This filtering (by way of a definition expression on the featureLayer) breaks the FeatureTable. A quick call to a refresh method would fix this easily for me.
1 Comment
MarkBuie1

This is an old post, so I'm not sure if this method was around at the time, but since this thread came up in my search for an answer to the same problem, I thought I would add my solution. I'm using ArcGIS API for Javascript 3.23. 

Basically, I added an event listener on the feature layer that was tied to the feature table. Anytime an edit is made on the feature layer, the feature table is refreshed. Note that any selections the user has made within the feature table will be rest. This works for the edits made from the toolbar as well (Delete, Undo, etc.)

<featurelayer>.on("edits-complete", function() {
    <featuretable>.refresh();
});

*First time posting, sorry if I have violated any rules.