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

68
1
10-06-2022 07:26 AM
NicolasGIS
Regular 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
1 Reply
LukeCalladine
New Contributor III

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