We need to build a kind of popup, but completely custom made.
I need specific fields that I get from the feature layer by using the PopupTemple:
for (var i = 0; i < featurelayer.popupTemplate.fieldInfos.length; i++) {
var fieldname = featurelayer.popupTemplate.fieldInfos[i].fieldName;
}
Important is the sort order of the fields and for most feature layers the sort order is the same as set in the AGOL portal.
When I use the standard ESRI popup, view.popup, the sort order is for most maps the same, and follows the AGOL portal setting. On some maps I have a different sort order. The sort order in the AGOL portal is the same as the sort order in view.popup, but different in my 'feature layer.popupTemplate.fieldInfos'. I cannot find the reason why it is sometimes different. Any ideas? How can I get the correct AGOL sort order information so I can manage to sort myself instead of following the fieldInfos array natural sort order?