jquery - How to add Show All and hide All in colvis code -
i have code colvis. work fine.
<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>
my problem want add additional button inside above code show , hide colvis data table not working. code below:
$(document).ready(function() { $('#example').datatable( { dom: 'c<"clear">lfrtip', columndefs: [ { visible: false, targets: 2 } ], colvis: { restore: "restore", showall: "show all", shownone: "show none" } }); });
how combine below code first code above?
colvis: { restore: "restore", showall: "show all", shownone: "show none" }
you must add letter c
in dom of datatable, letter refers show colvis:
"sdom": 'cr<"h"lfr>t<"f"ip>',
Comments
Post a Comment