var str ='';
function myFormatter(cellvalue, options, rowObject) {
if(rowObject.name== 'test'){
$.getJSON(loadUrl, function(jsnResponse) {
str=jsnResponse.address;
});
}else{
str = 'No value';
}
return str;
}
This is a function that i have written,the problem is that when this function is called, it first executes return str line and returns blank and then the if statement is executed and again the correct value is returned.
Any help will be appreciated.Thanks