Esri / Esri/oriented-imagery

[JS API 4.16 Support]

Open
#31 1 comment 0 reactions 1 assignee Claimed by @priya4991 View on GitHub
Dominant language
CSS
Stars
41
Forks
17
PR merge metrics
No merged PRs in 30d

Description

In JavaScript API 4.16, the constructor of `FeatureForm` becomes asynchronous.
As FeatureForm has to load data from ArcGIS Online, its creation is slower than the creation of `Update` & `Delete` buttons.

I changed
```js
var featureForm = new FeatureForm({
container: editingNode,
layer: layer,
feature: graphic,
fieldConfig: fieldInfos
});
//editable field change
domConstruct.place("" + this.nls.update + "" + this.nls.delete + "", featureForm.container);
console.log(featureForm.container);
featureForm.container.childNodes[1].addEventListener("click", lang.hitch(this, function () {
if (featureForm)
featureForm.submit();
}));
featureForm.container.childNodes[2].addEventListener("click", lang.hitch(this, function () {
layer.applyEdits({ deleteFeatures: [{ objectId: objectId }] }).then(lang.hitch(this, function (result) {
if (result.deleteFeatureResults.length) {
this.orientedViewer.refreshVectorLayer(layer.title);
this.sceneView.popup.clear();
this.sceneView.popup.close();
}

}));
}));
```
to
```js
var featureForm = new FeatureForm({
container: editingNode,
layer: layer,
feature: graphic,
fieldConfig: fieldInfos
});
featureForm._resourcesFetch.then(() => {
domConstruct.place("" + this.nls.update + "" + this.nls.delete + "", featureForm.container, "last");
console.log(featureForm.container);
featureForm.container.childNodes[1].addEventListener("click", lang.hitch(this, function () {
if (featureForm)
featureForm.submit();
}));
featureForm.container.childNodes[2].addEventListener("click", lang.hitch(this, function () {
layer.applyEdits({ deleteFeatures: [{ objectId: objectId }] }).then(lang.hitch(this, function (result) {
if (result.deleteFeatureResults.length) {
this.orientedViewer.refreshVectorLayer(layer.title);
this.sceneView.popup.clear();
this.sceneView.popup.close();
}

}));
}));
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.