I'm working with JSAPI 4.7
I really like Popup Templates for what they do out of the box - attribute substitution/functions/promises/actions. However, I would really like to place my popup contents somewhere else on my page (not on map). Like I do with LayerList and Legend widgets. However, when I set the container property for my popups, instead of putting my contents in it, it removes that element from it's parent node, and still floats it over the map. Not what I was expecting.
<SPAN class="keyword token">var</SPAN> view <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">MapView</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
container<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"viewDiv"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// Reference to the DOM node that will contain the view</SPAN>
map<SPAN class="punctuation token">:</SPAN> map<SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// References the map object created in step 3</SPAN>
center<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">90</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">50</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
zoom<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">5</SPAN><SPAN class="punctuation token">,</SPAN>
popup<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"queryResults"</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>And later in my view.on click event
view<SPAN class="punctuation token">.</SPAN>popup<SPAN class="punctuation token">.</SPAN><SPAN class="token function">open</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
title<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Results"</SPAN><SPAN class="punctuation token">,</SPAN>
content<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"This is some content"</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>So my question is - am I doing this wrong? I am assuming this behaviour is as designed, and I'm asking too much. However, I'd like to be pleasantly surprised.
Alternatively, is there a way to obtain the rendered content without the popup popping up, so I can insert it in the DOM myself? I'm hoping to use the popup templates for identify query task results.
Thanks