I have created link in datatable as:
$('#example').dataTable( {
"columnDefs": [ {
"targets": 1,
"render": function ( data, type, full, meta ) {
return '<a href="'+data+'" data-id="'+full.id+'">Download</a>';
}
} ]
} );
I can access id on clicking <a> tag using jQuery click event, but I have several fields to access. And I don't want to use data- attribute to access each field.
How can I access row object i.e.(full) , in jQuery event ?
What I have tried is:
"render": function ( data, type, full, meta ) {
alert(full);
return '<a href="'+data+'" data-full="'+full+'">Download</a>';
}
In jQuery event alert( $(this).data('full') ); I can see only [Object object].
I have tried to convert it to String but no success.
alertuseconsole.log($(this).data('full'))[object Object]