How To disable hyperlink for Value Interaction column

Recently at client place, came across very interesting requirement. The tone of requirement was very basic, but it was amazing to see the tremendous business value, for this requirement.
Following was the requirement :
If the data value in value interaction column is null, than there should be some “Custom Text” with out any hyperlink, but if column has value than functionality should be same as Out-Of-Box.
Steps to follow ::
  • In the Column Formula, under — Edit  Column Formula window — put following code (change “TableName”.”ColumnName” appropriately)  :
1case when "TableName"."ColumnName" is null then 'No Data' else "TableName"."ColumnName" end
  • Create Static Text View and add following Java Script, make sure Static Text View is last in the compound laye out :
01<script>
02var aElm=document.getElementsByTagName('td');
03for(var i=0; i<aElm.length; i++) {
04    if((aElm[i].className.indexOf("OOLD") > -1)){
05    //alert(aElm[i].innerHTML);
06        if((aElm[i].innerHTML.indexOf("<span><span>No Data</span></span>") > -1)){
07            aElm[i].innerHTML = '<span><span>No Data</span></span>';
08        }// end of if
09    }// end of if
10}// end of for
11</script>
  • Below image shows the final out come and Compound Lay out view.
Compound Layout and Final View
Compound Layout and Final View
I have tried explaining with an abstraction, I will be more than happy to answer any specific question