It seems I'm having another issue of scope on this same topic. I've updated my code to use dojo/ready and instead of the base infoWindow I'm now using a Popup. My formatting function is no longer being called. Is this a problem of scope or something to do with the Popup vs base infoWindow? Initially the formatCapacity() function was inside the ready(function(){*in here*}) as a global function but when it didn't work I moved it outside of the ready(). Either way it is not called. Everything else works.
require([
"esri/map",
"esri/dijit/Popup",
"esri/dijit/PopupTemplate",
"dojo/ready",
etc.....
....
] , function(
Map,
Popup,
PopupTemplate,
ready,
etc...
....
) {
function formatCapacity(value){
console.log("Formatting function is called");
}
ready(function(){
.....
.....
var popupTemplate = new PopupTemplate();
popupTemplate.setTitle("<b>${NAME}</b><br>")
popupTemplate.setContent("<b>Cable: ${CAPACITY_G:formatCapacity}</b>");
var popup = new Popup({
highlight: false,
titleInBody: true
}, dojo.create("div"));
etc....
....
....
});