AnsweredAssumed Answered

esri/widgets/Feature renderNow() broken from v4.10 onwards

Question asked by gavinharriss on Jul 15, 2019

As of v4.10 of the API the renderNow() method of the feature widget no longer seems to function correctly.

 

Previously in v4.9 the following code snippet would result in the full html being output to the html variable:

 

var div = document.createElement('div');
_graphic.attributes = feature.attributes;
var featureWidget = new Feature({ graphic: _graphic, container: div});
featureWidget.renderNow();
var html = div.outerHTML;

 

Using v4.10 - 4.12 results in only placeholder divs being output to the html variable, no actual data.

 

Example output from v4.9:

<div class="esri-feature"><div class="esri-feature__size-container"><div class="esri-feature__main-container"><div><font size="2">ID: 2062683<br>GIS Area (SqM2): 23.08</font></div></div></div></div>

 

Example output from v4.12:

<div class="esri-feature esri-widget"><div class="esri-feature__size-container"><h4 class="esri-feature__title"></h4><div class="esri-feature__main-container"></div></div></div>

 

If I use a $timeout (as in AngularJS app) and re-check div.outerHTML, it does provided the expected result after a brief pause so I imagine there's now some promise at play under the hood of renderNow().

Outcomes