var vliTemplate = new InfoTemplate("Visual", "<tr><b>VLI Number:</b> <td>${VLI_VLI_NO} </tr></td>"+
"<br><tr><b>Not Greened Up CFLB:</b><td>${Tbl_ResultSummary_VQO_Not_Greened_Up_Ha:NumberFormat(places:0)} Ha</tr></td>"+
"<br><tr>Greened Up CFLB:<td>${greened:compare} Ha</tr></td>"+
"<br><tr><b>Maximum Target Percent:</b><td>${Tbl_ResultSummary_VQO_Pct_tgt:NumberFormat(places:0)}%</tr></td>"+
"<br><tr><b>Maximum Target:</b><td>${Tbl_ResultSummary_VQO_Target_Ha:NumberFormat(places:0)} Ha</tr></td>")
compare = function (key) {
var result = diff;
switch (key) {
case "greened":
diff = data.Tbl_ResultSummary_VQO_HA - data.Tbl_ResultsSummary_VQO_Not_Greened_Up_Ha;
break;
}
return result;
};
I've been playing around with the code in my switch case function trying to get wording or placements of words to work for me, but I can't seem to get my popup to display anymore. In the popup, I want the line "Greened up CFLB" to show the calculation of Tbl_ResultSummary_VQO_HA - Tbl_ResultsSummary_VQO_Not_Greened_Up_Ha but now the popup won't even display (because I know I'm not writing my fucntion/switch statement correctly)
Can someone please provide feedback on where I'm going wrong in my code? I know its a simple case of not having the right things in the right place...but I'm at a loss.
Thanks!
"<br><tr>Greened Up CFLB:<td>${greened:compare} Ha</tr></td>"+
Where I say greened:compare - greened is not actually the name of any attribute that I have, I just created a name to put in there. Does this need to be one of my attributes that I'm using? Very new at js and been trying to work through this problem for a while. Thanks.