Select to view content in your preferred language

JS API 4.X: Editor widget - FormTemplate cannot have empty array of elements

467
2
10-06-2022 07:26 AM
NicolasGIS
Frequent Contributor

Dear JS API team,

I am wondering what is it not possible in the editor widget to have an empty array of elements in the FormTemplate ?

https://developers.arcgis.com/javascript/latest/api-reference/esri-form-FormTemplate.html#elements

If you set an empty array, all the attributes appear. You need to have at least one.

In my use case, I just want user to edit the geometry.

https://codepen.io/fdfdsfsdfsdfwetwg/pen/poVOEqm

In the meantime, any workaround to suggest ? 

 

Thanks for listening !

Tags (1)
0 Kudos
2 Replies
LukeCalladine
Occasional Contributor

Rather brute-force way but you could do the following:

 

      .esri-editor__panel-content__section__group{
        display:none;
      }

 

Add the above to your CSS.

 

 

            const editor = new Editor({
              view: view,
              layerInfos: [pointInfos],
              allowedWorkflows: "update"
            });

 

Tweak the editor with the last line of the code: allowedWorkflows: "update".

Your users will only be able to select a feature and then update its geometry - the attributes will be hidden.

 

0 Kudos
NicolasGIS
Frequent Contributor

Issue is still there in 4.26. 

Any thought from ESRI team ? Does it look like an expected behavior @HeatherGonzago ?

Thanks for listening !

0 Kudos