Using buttons
Using buttons
Hi altogether,
seems that I drew a mental black here... I don't get the buttons to show up.
I used the download builder and downloaded datatables including the whole buttons extension (all options). In my working datable I then added:
buttons: [ 'print', 'excel' ]
But no buttons showing up. After scanning the whole documentation I don't see any further things I need to do but this line... but no buttons.
Where is my mistake?
Thank you for your help!
This question has accepted answers - jump to:
Answers
Hi @thowi ,
The two most common causes are missing JS/CSS files, or
dom
hasn't been modified to display the buttons. This page here should get you going,Cheers,
Colin
Thank you Colin,
that helps! And I think I know where the problem is...
https://www.dropbox.com/s/1sohjbx3lsgdrhz/dom.jpg?dl=0
dom: 'Bfrtip',
won't work for be, because on top left position I have this pagelength dropdown.
Do you have a tip for me how to move that dropdown to bottom middle? Then I would have the possibility to put the buttons to the top left.
Thank you very much!
Hi @thowi ,
It depends on how you created the dropdown, so I need to see that working.
One other option is to create the button like this example here. With this, you can add it to any element in the DOM,
Cheers,
Colin
Hey Colin,
the dropdown was not specifically created.
This is my whole configuration:
When using line 14, the top left dropdown will disappear and no buttons show up.
Your "dom" needs an "l" for the page length dropdown.
So you mean
dom: 'Blfrtip',
right? Sadly doesn't work for me Now the dropdown is still there, but no buttons. Same look like my screenshot above.
As @tangerine said, the
l
does the length, see this example here. It would be worth read the page fordom
as there's some good examples on there.Mhhhh, very strange. I just opened the page in Chrome instead of Safari and there the 3 Buttons are available. Only in Safari they are not... strange!
That is strange - I'll get that looked at here in case it's a problem.
OK. I am using Safari Version 12.0 (13606.2.11) on High Sierra 10.13.6 (17G65)
On your browser's console could you run
navigator.userAgent
and show me the output please? I've only got El Capitan to hand at the moment unfortunately and it doesn't have the APIs needed to support the Excel download.Allan
Using that: https://w3schools.com/jsref/tryit.asp?filename=tryjsref_nav_useragent
Will show:
User-agent header sent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15
Does that help?
And, by the way good to know: jQueryUI buttons work. And the pagination buttons of datatables also work.
Quite interesting, after upgrading to Mac OS Mojave 10.14 (18A391) the buttons are there, also in Safari.
The Mojave upgrade also upgraded Safari to Version 12.0 (14606.1.36.1.9).
Before I was using Version 12.0 (13606.2.11) on High Sierra 10.13.6 (17G65).
Maybe the newer build fixed something?
I tried it with 10.13.6 (I think!) earlier today and it seems to work without an issue. Can't remember the exact version of Safari in that, but it was high enough to pass the check that I've got to make sure that the Safari version has the APIs needed to create the file. They were really late in adding that ability.
Allan