kwangu

Non-Ajax Datatable initialization bootstrap 3

Jul 15th, 2022
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <script>
  2. $(document).ready(function() {
  3. var table = $('#dtTable').DataTable( {
  4. lengthChange: true,
  5. lengthMenu: [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
  6. buttons: [{
  7. text: 'New Category',
  8. action: function ( e, dt, node, config ){
  9. location.href = 'category/cat_crud';
  10. }
  11. },
  12. 'excel', 'colvis'
  13. ],
  14.  
  15. //buttons: [ 'copy', 'excel', 'pdf', 'colvis']
  16.  
  17. } );
  18.  
  19. table.buttons().container()
  20. .appendTo('#dtTable_wrapper .col-sm-6:eq(0)');
  21. } );
  22. </script>
Add Comment
Please, Sign In to add comment