• Resolved Markgoessens

    (@markgoessens)


    Hi Tobias,

    I use the datatables extension with Tablepress.
    I’m trying to show info when a user wants to print a page.

    This is my modified rule in tablepress-datatables-tabletools.php

    $tabletools_options = '{ "sSwfPath": "' . $swf_path . '", "aButtons": [{ "sExtends": "print", "sButtonText": "", "sInfo": "Please press escape when done" } ] }';

    But no info appears. Am I doing something wrong?

    Greets Mark

    https://www.ads-software.com/plugins/tablepress/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Markgoessens

    (@markgoessens)

    As an addition, maybe this causes the problem; I use also datatables row details.
    I see, when I enable tabletools, these row details don’t work anymore.
    Maybe the two extensions will conflict with each other?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Yes, it’s likely that the TableTools script conflicts with the Row details. Unfortunately, as I’m not the author of that JS code, I’m not sure about it though, sorry.

    Please also not that the TableTools Extension has been superseded by the TablePress DataTables Buttons Extension from https://tablepress.org/extensions/datatables-buttons/
    Maybe you could try again with that?

    Regards,
    Tobias

    Thread Starter Markgoessens

    (@markgoessens)

    Hi Tobias,

    Thanks for your quick reply.
    I also tried datatables-buttons before, but there the problem was that I couldn’t hide some specific columns which I don’t want to print.
    Even when I use the @media css, the columns are still visible.

    This is the page with the table:
    https://www.vocalgroup-evolution.nl/nieuw2015/repertoire/

    And this is the css I used to hide some columns:

    @media print {
    #tablepress-1 .column-4,
    #tablepress-1 .column-5,
    #tablepress-1 .column-6 {
        display: none !important;
      }
    }

    Even when I hide the columns @media all, I still see them on the print screen.

    When this problem is solved, I’m happy too ??

    Greets Mark

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Mark,

    unfortunately, I don’t think that a CSS Media Query is going to help here ?? From what I know, the DataTables Buttons print function renders its own Print preview, where that CSS is not loaded.
    You could instead maybe take a look at https://datatables.net/reference/api/buttons.exportData() which could help here, according to its description. Unfortunately, I have never worked with this myself, so I can’t really help with it. :-/

    Regards,
    Tobias

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add sInfo to the print button, nothing changes’ is closed to new replies.