1. 要先下$.fn.dataTable.ext.errMode = 'none';
2. 再加入
.on('error.dt', function(e, settings, techNote, message) {
console.log( 'An error has been reported by DataTables: ', message);
})
1. 要先下$.fn.dataTable.ext.errMode = 'none';
2. 再加入
.on('error.dt', function(e, settings, techNote, message) {
console.log( 'An error has been reported by DataTables: ', message);
})
重點是img src要加上data:image/jpg;base64,,後面再接base64編碼的圖片檔。
<img src="data:image/jpg;base64," + base64code>
<?php | |
$file="/parh/to/binary"; | |
$fp = fopen($file, "rb"); | |
$binary = fread($fp, filesize($file)); | |
echo base64_encode($binary); | |
?> |
Q: 要在dataTAble一格內帶進data中的兩個變數該如何做?
<script type="text/javascript">
$(document).ready(function () {
$('#datatable-responsive').DataTable({
"columns": [
{"data": "fname"},
{"data": "phoneno"},
{"data": "email"},
{"data": "idno"},
{"data": "idno"},
{"data": "status"}
],
"processing": true,
"fixedHeader": true,
"serverSide": true,
"ajax": {
url: '../lib/request/viewrequests.php',
type: 'POST'
}
});
});
</script>
要實作列表拉到底時自動讀取新資料,但是遇到很多問題。
列表是使用react native的FlatList元件,一開始讀取資料進來時,就會觸發onEndReached的事件,明明甚麼動作都沒做,傻眼。