My goal is to replace a text in a specific column by an icon using only javascript.
function ReplaceTxtbyIcn(targetWP, targetColumn, pat, urlname)
{
var table = document.getElementById(targetWP);
if (table != null)
{
var tbody = table.childNodes[0];
var trs = tbody.childNodes;
for (var i=1;i<trs.length;i++)
{
var tdVal = trs[i].childNodes[targetColumn].outerText;
if( tdVal == pat)
{
$(trs[i].childNodes[targetColumn]).text('');
$(trs[i].childNodes[targetColumn]).append('<img src="******SomeURL******'+urlname+'.png" alt="'+pat+'"/>');
}
}
}
};
For targetWP it should be equal to ctx.listName + "-" + ctx.view My problem here is how to get the ctx for the specific webpart using the id of the webpart. I am on Sharepoint 2007, any help ?