I made a custom popup for a specific layer. But my method is really not good for Web Appbuilder/WebMap environment.
Section from the customPopup widget:
map = new Map("map", {
infoWindow: infoWindow,
});
//create a popup to replace the map's info window
var infoWindow = new InfoWindow({
domNode: domConstruct.create("div", null, dom.byId("map")),
});
var popupTemplate = new InfoTemplate();
popupTemplate.setContent(_getTextContent);
var featureLayer = new FeatureLayer(substationURL, {
mode: FeatureLayer.MODE_SNAPSHOT,
infoTemplate: popupTemplate,
outFields: ["*"],
});
this.map.addLayer(featureLayer);
featureLayer.on('load', lang.hitch(this, function() {
console.log("load");
LayerInfos.getInstance(this.map, this.map.itemInfo).then(lang.hitch(this, function(layerInfos) {
var