Buttons extension not showing up

Buttons extension not showing up

iceandeleiceandele Posts: 2Questions: 1Answers: 0
edited August 2015 in Free community support

Hi guys,
I would love to export my tables as excel(xls, not csv, as my data has paragraphs of text), so I looked into the TableTools extension, but it looks like it has been replaced with Buttons.

So tried fiddling around with that, but couldn't get the buttons to show up, and I can't for the life of me figure out what's wrong.

DataTables Debug:
http://debug.datatables.net/obibur

DataTables Live:
http://live.datatables.net/fipimuna/3/edit?html,css,js,output

Any help would be much appreciated.
Thanks!

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi,

    You need to use the B option in the dom option - like in the examples. You'll also need to include the HTML5 and / or Flash export buttons and any dependencies they have. The download builder is a good way of doing that.

    Allan

  • iceandeleiceandele Posts: 2Questions: 1Answers: 0

    thanks! adding the B in dom worked!

  • geodevgeodev Posts: 4Questions: 0Answers: 0

    Hello,
    I had buttons working with TableTools, and am having issues adding them with Buttons. I used the download builder and am using the table in a JQuery accordion. Suggestions?
    Thank you

    Works

    $('#resultsTable').DataTable({
           "dom": 'T<"clear">lfrtip',
            tableTools: {
              "sSwfPath": "media/swf/copy_csv_xls_pdf.swf"
            },
            "scrollY": true,
            "scrollY": "400px",
            "data": items,
            "columns": [
                 {"title": "Parcel"},
                 {"title": "Address"},
                 {"title": "Owner"},
                 {"title": "Account Num"}
              ]
          });
    

    Buttons not displaying

    $('#resultsTable').DataTable({
              dom: 'Bfrtip',
              buttons: [
                  'copy', 'excel', 'pdf', 'print'
              ],
              select: true,
              data: items,
              columns: [
                 {"title": "Parcel"},
                 {"title": "Address"},
                 {"title": "Owner"},
                 {"title": "Account Num"}
              ]
          });
    
  • ThomDThomD Posts: 334Questions: 11Answers: 43

    Buttons is a very modular extension. Did you load all the dependent js and css files? Show your work :)

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Yup - my suggestion is to give a link to the page you are having problems with, as per the forum rules, so we can debug it and offer some help :-)

    Allan

  • geodevgeodev Posts: 4Questions: 0Answers: 0

    Sorry, missed that rule and thanks for the direction. The debugger helped me find out that the download builder CDN was not being used. It is now and the buttons appear, however copy and Excel aren't working, print and PDF are.

    Debug results http://debug.datatables.net/utokat

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Can you link to the page please.

    I don't immediately see why that wouldn't be working, although given that you are using jQuery UI, you probably don't want to use dom - instead using the method shown in this example.

    Allan

  • geodevgeodev Posts: 4Questions: 0Answers: 0

    Hi Allan,

    Buttons 1.0.1 fixed the Excel issue, thank you!

This discussion has been closed.