Datatables with Buttons plugin example
Datatables with Buttons plugin example
top-node
Posts: 1Questions: 0Answers: 0
I am trying to get the buttons (https://datatables.net/extensions/buttons/) to show in my example fiddle - http://jsfiddle.net/juro/edbzfrxd/ . The only examples I have found overwrite the "show # entries" drop-down, which I still want to display.
In my case, I am rendering a table based on values from PHP (products in my case). Then I want to display a dropdown (status, e.g. "sold", "not sold", etc.) - clicking on one of these, the list is filtered.
Any ideas?
This discussion has been closed.
Replies
I couple minor changes to get it to work:
In the HTML changed class name from "datatable" to "display" .
Add the this CDN (its shown in the link you posted)
//cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/pdfmake.min.js
There are files for pdf buttons for older browers and html and some for HTML5 compatible browsers. You used the newer files but the older syntax for the buttons.
It should be "pdfHtml5" not "pdf" for the files you have included.
And last, you have to use the dom option to tell where to put the buttons
and
in dom, capital B is for button. Here is the details on that https://datatables.net/reference/option/dom
and here where it talks about the different button types:
https://datatables.net/extensions/buttons/built-in
dom:"lft<'bcontainer'B><ip>" might look better