**Edit** So I was able to get everything to work fine, still not sure what fixed it. Anyways, in a Content Pane, can I still run a switch case on my data so that calculations can be performed to populate my attributes field?For example in an InfoTable i would have had://"<br><tr><b>Calculation needed: </b><td>${calculate:compare6}Ha</tr></td>"
And then below I would have put in compare6 = function (value,key,data) {
var result = "", diff;
perform calculation to get area
switch (key) {
case "calculate":
diff = data.calculation1 - data.calculation2;
break;
}
How would this same task be performed when using graphic.attributes.data??**END EDIT**I have been struggling to get my attributes to show up in my TabContainer which I have placed inside an InfoTemplate. var infoWindow = new InfoWindow(null, domConstruct.create("div"));
infoWindow.startup();
map.infoWindow.resize(300,300);
//Operating area
var opareaTemplate = new InfoTemplate("Operating Area", "${OP_AREA}" )
//Create info template to hold the content inside
var vliTemplate = new esri.InfoTemplate();
vliTemplate.setTitle("VLI");
vliTemplate.setContent(getWindowContent);
//
function getWindowContent(graphic) {
//VQO
//make a tab container
var tc = new dijit.layout.TabContainer({
style:"width:100%;height:100%;",
useMenu: false,
useSlider:false,
}, dojo.create("div"));
//add content pane 1 and 2 - these are the tabs
var cp1 = new dijit.layout.ContentPane({
title: "Current",
content: "Visual: <tr><b>VLI Number:</b> <td>" + graphic.attributes.Tbl_ResultSummary_VQO_CFLBarea + "</tr></td>"
});
var cp2 = new dijit.layout.ContentPane({
title: "Approved",
content: "<br><tr><b>VQO: </b><td>\${Tbl_ResultSummary_VQO_EVQO_CD}</tr></td>"
});
tc.addChild(cp1);
tc.addChild(cp2);
return tc.domNode;
}
When I click on my layer service, I get the popup with the tabs as desired, however the attributes that are supposed to be collected from graphic.attributes.data shows up as "Undefined" and where I tried to replicate the code from my original infoTemplate code in my cp2 tab just show up as text: VQO: ${Tbl_ResultSummary_VQO_EVQO_CD}What am I missing?