Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81937

How do I append row data to a generated link

$
0
0

Hi,

So I've created a table using server side processing and I need to append data from the book number row to the link in the extra column i've created.

So for example, if the books number is 5 for that row, the link needs to be href="page/book/delete-book.php?5"

Here's my code:

$('#bookTable').DataTable({
"processing": true,
"serverSide": true,
"ajax":{
url :'book-data.php',
type: "post",
error: function(){
$(".book-table-error").html("");
$("#bookTable").append('<tbody class="book-table-error"><tr><th colspan="3">No data found in the server</th>
</tr></tbody>');
}
},
"columnDefs": [{
"targets": -1,
"data": null,
"defaultContent": '<a href="page/book/delete-book.php?"><i style="color:red;" class="fa fa-fw fa-trash"></i>
</a>'
}]
});

My understanding is that I need a way to basically reference the data from my ajax request but I have no idea how

Any help would be much appreciated!


Viewing all articles
Browse latest Browse all 81937

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>