Export button issues - Code adding 2 search boxes & 2 Navigation bars
Export button issues - Code adding 2 search boxes & 2 Navigation bars
Description of problem:
Hello, have been struggling for weeks with getting 'Export buttons' to work. Using the current code they don't appear, so researched Stackoverflow and found code that makes the buttons appear - but now show 2 search boxes and 2 navigations bars.
I am new to DataTables, and am sure the issue is with me having 2 x "/js/jquery.dataTables.min.js" scripts! But if I remove one or the other, I get variations of the table not responding/export buttons disappear etc.
Any help appreciated!!!
CODE: (Attached)
This question has accepted answers - jump to:
Answers
Load order is important. You are getting errors in the browser's console, some like this:
I moved the order of your script so everything loads in the proper order:
http://live.datatables.net/xomigeha/1/edit
Also note that your page isn't a properly formatted HTML page. If you need help with your HTML layout please use a resource like w3cschools for tutorials.
Kevin
Full Code (Excuse the mess):
@wixy Have you resolved this? If not, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Morning Colin - Saddly no.
I have managed to remove one of the Search boxes, now just leaving me with 2 nav bars at the bottom - It's certainly me messing up the order, somehow overcomplicating things I believe!
Have popped a test case link below:
https://www.flighteducation.co.uk/PORTALS/TEST%20Case.php
Many thanks for all the support again!
You are loading two versions of DataTables.
Hi Tangerine - Thanks for your response and eagle eye!
Have amended to the same version, but still no resolve, unfortunately.
Thanks again.
That implies that you are still loading DT twice. Only load DT once.
Hi Tangerine -
Have just tried rebuilding the file from scratch again with just 1 DT - but again, the buttons do not appear:
https://www.flighteducation.co.uk/PORTALS/TEST%20Case2.php
You have the console error "Uncaught Unknown button type: print", which suggests that you are missing the buttons.print js file.
https://cdn.datatables.net/buttons/1.6.5/js/buttons.print.min.js
Thanks tangerine (again) - no joy!
If I remove the DT script before the:
Console Error states that the code "Datatable is not a function"
When it is put back in - at does the 2 DataTables thing again.
Removing the one at the end of the code string - causes it all to fail.
Have added the 'searching': false, back into the code above, which removes one of the search boxes.
Are you aware of another function that will take away the double Nav bars at the bottom?
You are still loading DataTables twice. Also you are loading jQuery three times.
Also you have two of these
where you only need one.
It seems that you need to return to basics and study some simple examples of web page design with DataTables.
You were absolutely right! Have gone right back to basics and all is working fine bar one issue now (sorry!!)
Now I cannot get the dropdown that allows you to choose the amount in the table, she has disappeared!
Thanks, and apologies again!
https://www.flighteducation.co.uk/PORTALS/TEST%20Case5.php
See this FAQ.
Kevin
I actually think I could cry!!
Gentlemen - I seriously cannot thank you enough, for all your time and efforts!!!