1
我有這個代碼從科爾維斯。它工作正常。如何添加顯示全部並隱藏所有在colvis代碼
<script>
$(document).ready(function() {
var table = $('#record_fpa1').DataTable({
"sDom": 'R<"H"lfr>t<"F"ip>',
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
var colvis = new $.fn.dataTable.ColVis(table);
$(colvis.button()).insertAfter('div.info');
});
</script>
我的問題是我想裏面添加上面顯示所有代碼的其他按鈕,隱藏所有colvis數據表,但它不能正常工作。代碼如下:
$(document).ready(function() {
$('#example').DataTable({
dom: 'C<"clear">lfrtip',
columnDefs: [
{ visible: false, targets: 2 }
],
colVis: {
restore: "Restore",
showAll: "Show all",
showNone: "Show none"
}
});
});
如何將以下代碼合併到上面的第一個代碼?
colVis: {
restore: "Restore",
showAll: "Show all",
showNone: "Show none"
}
對不起,我用這個用PHP代碼..我刪除php標籤 – airi