giterlizzi / dokuwiki-plugin-datatables

Add DataTables support to DokuWiki
GNU General Public License v2.0
10 stars 10 forks source link

Buttons don't show up #54

Open Digitalin opened 3 years ago

Digitalin commented 3 years ago

Hello,

with syntax described in the official doc, I 've tried different possibilities buttons='[ "copy", "csv", "print" ]' or just buttons="csv" to insert in a datatables declaration : <datatables page-length="25" responsive="true" .... > there is no errors, different settings work except the buttons. As this option is not described in your website, does it work from your side or this option is not yet implemented.

Thank for your efforts.

rtgibbons commented 3 years ago

Just spent some time diving into why this wasn't working for me; It wasn't obvious but you have to tell DataTables where to install the plugins https://datatables.net/extensions/buttons/#Displaying-the-buttons

The below worked for me.

<datatables dom='Bfrtip' buttons='["csv"]'>
  # Table Data
</datatables>
Digitalin commented 3 years ago

Hi, Thanks for the hint. It works well. I have played with the DOM datatables options following your link. dom='B' only works and all buttons are displaying but without paging, search box and select for entries number. B seems to stand for buttons.

dom='Blfrtip' Adding l in Blfrtip to get the select box for entries number domB4buttons

As you 've explained dom='Blfrtip' buttons='["csv","print"]' to get only specified buttons

listerr commented 3 years ago

Thanks for this @rtgibbons - I spent quite some time trying to get this to work as documented.

This works for me, but with bootstrap3 template, the layout seems to go slightly wrong in that each element now appears on a new line, rather than appearing neatly together next to each other as it did before. To make it look slightly less messy on the page, I moved the buttons so they appear underneath the table with dom='rlftipB' I don't really have enough CSS knowledge to know how or where to correct this, though.

image