Ayesha Fathima

Ayesha Fathima

  • NA
  • 184
  • 29.9k

Call function on click of column in hyperlink itself

Feb 6 2018 1:24 AM
Hi there,
I am forming table using Ajax,giving hyperlink on one column,onclick of that column i need to call one function.How to call that function while forming hyperlink itself.
  1. $('#attachmenttable').DataTable( {  
  2.              retrieve: true,//need to write this line otherwise it wil throw an error like "cannot reinitialize data table"  
  3.              paging: false,  
  4.              searching:false,  
  5.         data: desired,  
  6.         columns: [  
  7.             { title: "File Name",visible:true,"render"function ( data, type, row ) {  
  8.                         return '<a href="javascript:void(0)">' + data + '</a>';  
  9.                       }},  
  10.             { title: "Base64",visible:false }  
  11.         ]  
  12.     } );  

Answers (2)