Created
October 15, 2020 06:26
-
-
Save anta40/20959d81778d3049e4dadce05453c03b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="DataTables/datatables.min.js"></script> | |
<script> | |
var theTable = null; | |
$(document).ready(function() { | |
theTable = $('#table-customer').DataTable({ | |
"processing": true, | |
"serverSide": false, | |
"ordering": true, | |
"order": [[ 0, 'asc' ]], | |
"ajax": | |
{ | |
"url": "http://localhost/myshop/showdata.php", | |
"type": "GET" | |
}, | |
"sAjaxDataProp": "data", | |
"deferRender": true, | |
"aLengthMenu": [[5, 10, 20, 50],[ 5, 10, 20, 50]], | |
"columns": [ | |
{ data: "cust_id" }, | |
{ data: "cust_name" }, | |
{ data: "cust_addr" }, | |
{ data: "cust_email" }, | |
{ data: "cust_phone" }, | |
{ data: "cust_photo", sortable: true, render: function (o) { return '<button id="btn1" onclick="displayImage(data)">Show</button>';} | |
] | |
}); | |
}); | |
function displayImage(link){ | |
window.alert(link); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment