4.4 popupTemplate fieldInfos label bug?

649
1
Jump to solution
07-26-2017 07:32 AM
BrandonFlessner
Occasional Contributor

I am using the fieldInfos to set the content in a popup. At 4.3, I could put html in the label property to take advantage of the title attribute that would show a description of the field when the user hovered. At 4.4, the html is not converted to text. 

fieldInfos: [{
        fieldName: "SufficiencyRating",
        visible: true,
        label: "<span title='An indication of the bridge&rsquo;s capacity to remain in service (0 -100)'>Sufficiency Rating</span>"
    }]

at 4.3: 

(not sure why the screen shot has transparency on the tooltip, please ignore)

at 4.4:

Here are a couple JSBins to show the problem:

4.3: JS Bin - Collaborative JavaScript Debugging 

4.4: JS Bin - Collaborative JavaScript Debugging 

Is this a bug? Is there another way to accomplish this?

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

Looks like this capability was removed at 4.4 during some re-work to the popup source. We'll look at adding the ability to specify html in the fieldInfos back for the next release. 


In the meantime the workaround would be to build the table content yourself and specify it using the popup template content. You could take advantage of the popup renderer classes to make your table look like the default popup table.  Here's an example: 

'<table summary="List of attributes and values"><tbody><tr><th class="esri-popup-renderer__field-header">MARRIED_CY</th><td class="esri-popup-renderer__field-data">{MARRIED_CY}</td></tr><tr><th class="esri-popup-renderer__field-header">NEVMARR_CY</th><td class="esri-popup-renderer__field-data">{NEVMARR_CY}</td></tr><tr><th class="esri-popup-renderer__field-header"><span title="test">Hover for tooltip</span></th><td class="esri-popup-renderer__field-data">1,509</td></tr></tbody></table>'

View solution in original post

1 Reply
KellyHutchins
Esri Frequent Contributor

Looks like this capability was removed at 4.4 during some re-work to the popup source. We'll look at adding the ability to specify html in the fieldInfos back for the next release. 


In the meantime the workaround would be to build the table content yourself and specify it using the popup template content. You could take advantage of the popup renderer classes to make your table look like the default popup table.  Here's an example: 

'<table summary="List of attributes and values"><tbody><tr><th class="esri-popup-renderer__field-header">MARRIED_CY</th><td class="esri-popup-renderer__field-data">{MARRIED_CY}</td></tr><tr><th class="esri-popup-renderer__field-header">NEVMARR_CY</th><td class="esri-popup-renderer__field-data">{NEVMARR_CY}</td></tr><tr><th class="esri-popup-renderer__field-header"><span title="test">Hover for tooltip</span></th><td class="esri-popup-renderer__field-data">1,509</td></tr></tbody></table>'