I'm using datatables to show the data from API which I saved in my local database. I want to add images to every record when click on some edit button to show the form and to have the possibility to browse picture in my machine and render it in another column in datatables.
Any idea or resource how to achieve this?
my current jQuery script:
<script>
$(document).ready(function() {
var data;
fetch("http://192.168.1.80:8000/fetchapi/")
.then(response => response.json())
.then(json => data = json)
.then(() => {console.log(data);
$('#datatable').DataTable( {
data: data.users,
deferRender: true,
scrollY: false,
scrollX: false,
scrollCollapse: true,
scroller: true,
columns: [
{ data: "user_id" },
{ data: "user_name" },
{ data: "user_email" },
{ data: "status" },
{ data: "user_type" },
]
} )
})
} );
$(document).ready( function () {
$.fn.DataTable.ext.pager.numbers_length = 5;
var table = $('#example').DataTable({"pagingType": "full_numbers"});
} );
</script>