Custom popup content

Explore in the sandboxView live

This sample demonstrates how to work with custom content elements within the PopupTemplate's content. There are five types of popup elements: fields, media, text, attachments, and custom. The custom content elements is set via the creator property. This property passes in a function which returns either a: String, HTMLElement, Widget, or Promise.

This particular sample shows how to set two types of custom content in the PopupTemplate's content. The first contains a Search widget. The second is a promise resulting from a QueryTask.

Click on a state within the map to display the popup. Notice that these two elements display. It is possible to search for another state within the Search widget. It will zoom to the selected feature and update the existing popupTemplate with that state's information.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.