Reg - buttons not working

Reg - buttons not working

armaanarmaan Posts: 19Questions: 7Answers: 1

default datatable plugin is working for me.... when i try addding buttons like excel copy the whole datatable is not working

This question has an accepted answers - jump to answer

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    You are probably missing one or more button related include. Take another look at the download builder

  • armaanarmaan Posts: 19Questions: 7Answers: 1

    in the starting i used only datatable it worked fine ..now i m using all the the includes provided for the button by the download builder but after rewriting to this code
    $(document).ready(function() {
    $('#example').DataTable( {
    dom: 'Bfrtip',
    buttons: [
    'copy', 'csv', 'excel', 'pdf', 'print'
    ]
    } );
    } );
    datatable itself is not working

  • allanallan Posts: 63,160Questions: 1Answers: 10,406 Site admin

    I don't see anything fundamentally wrong with that code. Please link to a test page showing the issue. 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.

    Allan

  • armaanarmaan Posts: 19Questions: 7Answers: 1

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

    I have put the code for export to function but it doesnt show up in the table

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Reference jquery.dataTables.js before dataTables.buttons.js.

  • armaanarmaan Posts: 19Questions: 7Answers: 1

    http://live.datatables.net/rezituma/4/edit @tangerine i did now the datatable itself not working

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    You also moved jQuery. DataTables expects to find jQuery js already referenced.

  • allanallan Posts: 63,160Questions: 1Answers: 10,406 Site admin
    Answer ✓

    The download builder might be useful to get things in the right order.

    The live site is a little crap in that respect since it can insert them in the wrong order.

    You also need to include the Button types for the export and any dependencies they have. Again, the download builder is the best way of doing this rather than guessing at them (heck - even I wouldn't get it right all the time and I wrote the software).

    Allan

  • armaanarmaan Posts: 19Questions: 7Answers: 1

    Thanks @allan & @tangerine will try both of your suggestions and come back

  • armaanarmaan Posts: 19Questions: 7Answers: 1

    omg thanks @allan its working after 4 days struggling its working thanks a lot

This discussion has been closed.