In my custom widget i have a datagrid and on row click i am showing the location and infowindow on map. Whereas When popupPanel is set to openAtStart: true then the infowindow is not displayed.
This issue is happening with Query widget also when we search and click on location the infowindow is not displayed.
What code changes needs to be done to display the Infowindow content in PopupPanel from all custom widget and query widget.
Appreciate your help in Advance.
Regards,
Kafil
Solved! Go to Solution.
OK, so what you want to do then is to add a PopupTemplate to your graphic then. Some code like this and your custom code/widget will use the Popup Panel widget instead:
//define a popup template
var popupTemplate = new PopupTemplate({
title: "{title}",
description: "{description}"
});
var graphic = new Graphic(point,symbol,null,popupTemplate);
this.map.infoWindow.setFeatures([graphic]);this.map.infoWindow.show(point);
@KafilBaig Not showing the standard popup is by design. Why would you have the same info displayed in the maps popup and the popup widget at the same time? Anyway the widget.js is pretty clearly marked where the maps popup is hidden. It even has the comment .
//hide the standard esri popup instead
html.addClass(query('.esriPopup')[0], 'myPopupHidden');
@RobertScheitlin__GISP I don’t want to show infowindow and popup panel widget at the same time . My query is instead of default info window how should I call the custom popup panel widget from my custom widget to display the content .
Check out the infoWindow events. I just wrote this code for something I was doing.
uses 'dojo/_base/connect',
@KarenRobine1 You should be careful about using code that has been depreciated. 'dojo/_base/connect' is one of those that has been depreciated for many years. If you are still using it then you really need to update your code to use dojo/on.
Hah hah. Thanks Robert. That's what I get for grabbing code from another application I developed years ago. I will change it.
OK, so what you want to do then is to add a PopupTemplate to your graphic then. Some code like this and your custom code/widget will use the Popup Panel widget instead:
//define a popup template
var popupTemplate = new PopupTemplate({
title: "{title}",
description: "{description}"
});
var graphic = new Graphic(point,symbol,null,popupTemplate);
this.map.infoWindow.setFeatures([graphic]);this.map.infoWindow.show(point);