Hi,
I have a xpage with a view control. In that control I have (icon) columns that are calculated with javascript.
This is what I use
if(viewEntry){
var idx = viewEntry.getColumnValues().get(6);
if (idx == 0) return;
var path = "/icons/vwicn" + ("00"+idx).right(3) + ".gif"
return "<IMG SRC='" + path + "' ALT=''>";
}
But what I sould like is to specify
return getIconImage(6)
And have the function defined in a javascript library or an other central location in my NSF.
function getIconImage(nr)
{
if(viewEntry){
var idx = viewEntry.getColumnValues().get(nr);
if (idx == 0) return;
var path = "/icons/vwicn" + ("00"+idx).right(3) + ".gif"
return "<IMG SRC='" + path + "' ALT=''>";
}
}
How can this be done?