As the subject line suggests, the data in a popup for a feature layer record does not update after I update attributes using the featurelayer.applyedits() method. Attributes updates are done by the user in a separate dialog window. I even refresh/redraw the featurelayer upon completed execution. If I am zoomed into the record and then zoom to full extent of the map after I apply the edits, the map finally will go out and refresh the dataset. Any ideas on forcing the featurelayer to refresh the data? I am also using on demand mode for the feature layer.
Thanks.
Solved! Go to Solution.
You could use the infowWindow InfoWindow | API Reference | ArcGIS API for JavaScript and use the setContent method to populate it.
When you say refresh/redraw do you mean you use this method? FeatureLayer | API Reference | ArcGIS API for JavaScript
Yes, that’s the one. After a closer look at refresh(), I called clearSelection() before that just to make sure the feature layer didn’t have that record selected for some reason. Still didn’t work. My popup is just the standard popup that I ripped from the JS Popup sample.
I may just get rid of the popup and create my own dojo dialog popup.
You could use the infowWindow InfoWindow | API Reference | ArcGIS API for JavaScript and use the setContent method to populate it.
Okay,
So just sent the click event on the feature layer to my console so I can view the entire event. Looks like it really is not refreshing the layer at all, even though the edits post successfully. I thought it might just something to do with the popup class.
So yea, I took the Object ID from the click event and ran a querytask to get the data, and outputted to the console in addition to the original click event. The original click event maintains the previous data even after the edits while the query gets the updated info. So I'll have to update an infoWindow using the query rather than the click event, or I can create some dojo dialog popup as well. Thanks for your help!