Select to view content in your preferred language

EB Custom widget - update features AND refresh DataSource

197
1
01-23-2025 08:42 AM
tssaus
by
Emerging Contributor

After calling applyEdits from the FeatureLayer object, the edits post successfully. However, in the map view, the edits do not refresh. I have a table like view that pulls the selectedRecords from the current DataSource (with DataSourceComponent). I have to redo my selection for any updates to show in my table.

 

let layer = ... // FeatureLayerDataSource#layer

const updateFeatures = // some updates...

const result = await layer.applyEdits({ updateFeatures: updateFeatures });

// result procesess successfully

layer.refresh() // this does nothing

 Thought layer.refresh() was the ticket out but apparently not. How can I force an update?

0 Kudos
1 Reply
Allen_Zhang
Frequent Contributor

Hi tssaus!

You can try below methods to refresh the dataSource:

dataSource.afterAddRecord(addedFeature)

dataSource.afterUpdateRecord(updatedRecord)

dataSource.afterDeleteRecordByIds(recordIds)

0 Kudos