Print not working in version 1.9.4

Print not working in version 1.9.4

hitesh.maiskarhitesh.maiskar Posts: 11Questions: 3Answers: 0

Hi,
I want to implement print functionality on datatable.
Its working fine for latest datatable js (1.10.15) but not working for version (1.9.4).
I am getting below error for 1.9.4 version datatable.js.:
Uncaught TypeError: Cannot read property 'register' of undefined

I can't refer latest js as its changing datatable behavior and I don't want to apply it through the project.

Below is my datatable settings:

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.3.1/css/buttons.dataTables.min.css">

(@*Working fine *@)

(@* Not Working for version 1.9.4 *@)


$('#example').DataTable( { dom: 'Bfrtip', buttons: [ { extend: 'print', message: 'This print was produced using the Print button for DataTables' } ] } );

Please help me to find some solution for print in same version js.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,478Questions: 1Answers: 10,467 Site admin
    Answer ✓

    Buttons does not work with 1.9.4 or earlier. That version of DataTables is no longer supported at all.

    If you need print functionality in a legacy version, you could use TableTools, although that also is no longer supported.

    Allan

  • hitesh.maiskarhitesh.maiskar Posts: 11Questions: 3Answers: 0

    Hi Allan,
    Thank you very much for your response.

    I gone through "TableTools" but could not find code for print. Can you please share sample code to implement print by using "TableTools"

    Thanks,
    Hitesh.

  • hitesh.maiskarhitesh.maiskar Posts: 11Questions: 3Answers: 0

    Hi Allan,
    I am updating datatable version. So don't respond to above question. I am facing one issue in updated version and raised another ticket [Print: Hide column from Printing].
    It will be helpful if you can respond it asap.

    You can close this ticket.

    Thanks,
    Hitesh,

This discussion has been closed.