File export buttons are not being rendered

File export buttons are not being rendered

sergio_101sergio_101 Posts: 5Questions: 1Answers: 0
edited March 2018 in Free community support

I am currently having issues rendering the file export buttons. The actual site is on a branch on my local machine, so I can't post a link, but I can post the debugger link and all relevant info.

I am using the download version of the datatables. I have included all of the pieces I need: buttons, jszip, pdfmake, vfs_fonts, etc.

The link to the debugger is:

https://debug.datatables.net/izidom

And the first lines in the table initialization look like:

    "dom": "Bfrtip",
    "buttons": ["copy", "csv", "excel", "pdf", "print"],

Can someone take a look at the debugger output and let me know if something looks incorrect?

Thanks!

Answers

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    Are none of the buttons showing?

    Do you see any errors in your browser's console?

    Maybe you can post a test case so we can help debug:
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • sergio_101sergio_101 Posts: 5Questions: 1Answers: 0

    none of the buttons are showing.. i am getting nothing related to this error in the console.

    looking at the test case info, and will send over..

    thanks!

  • sergio_101sergio_101 Posts: 5Questions: 1Answers: 0

    okay.. I have the buttons showing using live.datatables.net .. there must be an issue with the TONS of processing that goes on when initializing the table.. or maybe in the way that the libraries are being loaded in the application..

    http://live.datatables.net/jigerono/1/edit

    This is a bare bones representation of the table on my site. it works..

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    Thanks for posting the test case. If nothing else a working test case gives you a baseline to start troubleshooting from. Maybe there are site specific code structures you can add to the test case to try replicating the issue. For the buttons to appear its less about the actual table data and more about the environment.

    Kevin

  • sergio_101sergio_101 Posts: 5Questions: 1Answers: 0

    Thanks so much for pointing me to the test case!

    it turns out it was this line

    sDom : '<"dataTable_header"<"header_left"<"icon-list">>lf>t<"bottom"ip>',
    

    So i need to figure out what they were doing with that...

    but i threw everything into the test case and did surgery on it..

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    Glad you found it.

    Kevin

  • sergio_101sergio_101 Posts: 5Questions: 1Answers: 0

    ok.. this can be closed..
    it looks like sDom is an legacy option, which overrides the new 'dom' option..

    to fix it, i just renamed sDom to 'dom' and add "B" for buttons like so:

    dom : '<"dataTable_header"<"header_left"<"icon-list">>lBf>t<"bottom"ip>',
    

    Thanks for the pointers!

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945
    edited March 2018

    You are correct that sDom is legacy, however you can still use it - backward compatible. I think in your case since it came second in the config it overwrote the first dom in the config.

    Kevin

This discussion has been closed.