Buttons not appearing on the page
Buttons not appearing on the page
james55
Posts: 3Questions: 1Answers: 0
Hi Alan,
Below is the code that i use to intialize the my datatables
var table = $("[id$='MainTable']").dataTable({
"sDom": "Bfrtip",
"buttons": [
'copy', 'excel', 'pdf'
],
"sPaginationType": "full_numbers",
"sPageLast":"last",
"bAutoWidth": false,
"iDisplayLength": 25,
"aoColumns": [
{ "sWidth": "2%" },
{ "sWidth": "14%" },
{ "sWidth": "14%" },
{ "sWidth": "24%" },
{ "sWidth": "24%" },
{ "sWidth": "14%" },
{ "sWidth": "12%" },
{ "sWidth": "8%" }
]
});
The buttons are just not appearing on the page. What am i doing wrong here?? Also, this is on a VisualForce page in Salesforce CRM.
This discussion has been closed.
Answers
Did you include the button js and css files?
yes i have..
And have you included the dependencies for the buttons you have selected? For example the HTML5 buttons, JSZip, etc?
Really we'd need a link to the page (per the forum rules) to be able to offer any help.
Allan
All of them.
<apex:includeScript value="https://code.jquery.com/jquery-1.11.3.min.js"/>
<apex:includeScript value="https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"/>
<apex:includeScript value="https://cdn.datatables.net/buttons/1.0.3/js/dataTables.buttons.min.js"/>
<apex:includeScript value="https://cdn.datatables.net/buttons/1.0.3/js/buttons.flash.min.js"/>
<apex:includeScript value="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"/>
<apex:includeScript value="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"/>
<apex:includeScript value="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"/>
<apex:includeScript value="https://cdn.datatables.net/buttons/1.0.3/js/buttons.html5.min.js"/>
<apex:includeScript value="https://cdn.datatables.net/buttons/1.0.3/js/buttons.print.min.js"/>
<apex:stylesheet value="https://cdn.datatables.net/1.10.9/css/jquery.dataTables.min.css" />
<apex:stylesheet value="https://cdn.datatables.net/buttons/1.0.3/css/buttons.dataTables.min.css" />
Okay - in that case we really would need a link to the page so we can debug what is going wrong.
Allan
Is
"sDom": "Bfrtip"
correct or should he just be using"Dom": "Bfrtip"
?Use
sDom
(which is the legacy option) ordom
. There is noDom
option (Javascript is case sensitive).Allan