Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82528

Datatable 2.0.7 button in layout giving error

$
0
0
new DataTable('#SpfxDatatable', {
      pageLength: 10,
      language: { "search": "Filter: " },
      retrieve: true,
      responsive: true,
      scrollCollapse: true,
      scrollY: '50vh',
      buttons: [{ text: 'Show all groups', action: function () { alert('Clicked'); }, className:'hideEmptyButton' }],
      layout: {
        topStart: {
          buttons: [
            'copy', 'excel', 'pdf'
          ]
        },
        topEnd: 'search',
        bottomStart: 'info',
        bottomEnd: 'paging'
}
    })

When i use DOM opttions all the features align left. When I try to use layouts, buttons is not available.
I am using it in a spfx solution with react and have imported all the necessary components.

import 'datatables.net-buttons-dt';
import 'datatables.net-dt/css/dataTables.dataTables.min.css';
import 'datatables.net-responsive-dt';
import DataTable from 'datatables.net-dt';

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.


Viewing all articles
Browse latest Browse all 82528


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>