AnsweredAssumed Answered

set Infowindow conditional content?

Question asked by mborr on Aug 21, 2014
Latest reply on Aug 22, 2014 by mborr

Hi,

 

I am displaying an infowindow with content pulled from a pulldown setting as follows (code shortened for clarity). I want to display the record pulled from the database (var content), but what I need to do is, if the number equal zero, the infowindow content will show as "Data not available". I'm stuck on how to start this. Use an if then statement? An SQL query? I can't seem to find examples in any literature Ive searched.

 

Thanks

 

 

 

if (s.value==="male" && a.value==="allage" && r.value==="white" && p.value==="bpov"){          var maxval=1236;     var field="WBPME_Tota";     var title=("<b>White Male Below Poverty</b><br>");     var content=("<b>Count: </b>${WBPME_Tota}");                        } else if (s.value==="mandf" && a.value==="allage" && r.value==="allrace" && p.value==="bpov"){            var maxval=100;     var field="Mpoverty";     var title=("<b>Total Poverty (all ages) )</b><br>");     var content=("<b>Count: </b>${MFpoverty}"); }   var tracttemplate=new esri.InfoTemplate(); tracttemplate.setTitle(title); tracttemplate.setContent(content);

Outcomes