How To add Edit And Delete Button to the Dynamically Created Column to each rows
How To add Edit And Delete Button to the Dynamically Created Column to each rows
![bhushan_dhok](https://secure.gravatar.com/avatar/974a292c4a7e501834048a9bf96d1a09/?default=https%3A%2F%2Fvanillicon.com%2F974a292c4a7e501834048a9bf96d1a09_200.png&rating=g&size=120)
I am Having JSON object from which i am creating Dynamic Columns. At 5th position i am having ID which i want to pass to Server. How do i achieve it on click of specific button
var jsonData=data[key[0]];
var column=data[key[1]];
$('#example').DataTable({
data: jsonData,
columnDefs: [
{
targets: 5,
render: function(data, type, full, meta){
if(type === 'display'){
data =
'<button class="btn-edit" type="button">Edit</button>'
+ '<button class="btn-delete" type="button">Delet</button>';
}
return data;
}
}
],
columns: column
});
This discussion has been closed.