Ayesha Fathima

Ayesha Fathima

  • NA
  • 184
  • 27.8k

Give Hyperlink and color to Datatable column

Mar 20 2018 1:59 PM
Hi There ,
 
Iam trying to keep hyperlink and color based on some other column value.But it is not happening.Kindly suggest something.I wad able to give color and hyperlink individually but combining is not happening.
 
below is my sample code
  
  1. {  
  2.                      data: "TR_INCIDENT_NO",  
  3.                      defaultContent: "",  
  4.                      targets: 2,  
  5.                      "render"function ( data, type, full, meta ) {  
  6.                      var colorflag=full.TR_READ_APP_STATUS;  
  7.                      if(colorflag!=0)  
  8.                      {  
  9.                      return '<p class="colorforinc">'+'<a href="javascript:void(0)" onclick="setflagfunction()">'+data+'</a>'+'</p>';  
  10.                      }  
  11.                      else  
  12.                      {  
  13.                      return '<p class="negative">'+'<a href="javascript:void(0)" onclick="setflagfunction()">'+data+'</a>'+'</p>';  
  14.                      }  
  15.                  },                     
  16.                      visible: true  
  17.                  },  
 

Answers (2)