From my (3D) custom widget in WAB Developer Edition 2.17, I need to define featureLayer popupTemplate that will display a table of the field names and field values, very much like the default popup (e.g. when I click on a feature).
The reason is that I need to "immitate" esri default popupTemplate.
I will appreciate help.
I tried:
featureLayer.popupTemplate = {
"title": `${layerTitle}`,
"content": featurePointed => {
const dv = document.createElement("div");
let num = featureLayer.fields.length;
dv.style.height = `${num * 20}px`;
featureLayer.fields.forEach(field => {
let row = document.createElement('li');
row.feature = featurePointed;
row.textContent = `Name: ${field.name} Value: ${featurePointed.graphic.attributes[field.name]}`;