I update a Client-Side FeatureLayer by calling featureLayer.applyEdits(edits), but featureLayer.source doesn't get updated.
You can listen the layers "edit" event and call the featureTable refresh method.
https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#events-summary
https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#refresh
Demo: https://codepen.io/odoe/pen/mdOJeYm?editors=0010
Hi there, You cannot use source to get the features that are added or updated once after the client-side feature layer is initialized. You need to use FeatureLayer.queryFeatures to get the features in your client-side query.
@UndralBatsukh
I use FeatureTable with client-side FeatureLayer. FeatureTable is not updated after calling featureLayer.applyEdits(edits).
How do I update FeatureTable?
Please see my another post:
https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-working-featuretable-using-client-side/m-p/1524078#M85410
Thanks.
Forrest
@ReneRubalcava
It works after calling featureTable refresh method in
By the way, how to clear/remove all features in FeatureLayer?
Is it the right approach?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.