Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Unfortunately, I’m not really sure if and how the new Buttons plugin allows selecting rows for printing or saving. It might be possible that this has not yet been implemented in the new version of the add-on.

    Renaming should be possible using a “Custom Command”, but I don’t have that at hand at the moment. I suggest that you check the documentation at https://www.datatables.net/reference/button/ and try to find it, then add it to the “Custom Commands” textfield on the table’s “Edit” screen.

    Regards,
    Tobias

    Thread Starter estarella

    (@traductordemenu)

    Thanks for answer.
    I wait for a new version with this addon .
    ??

    Regards

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome!

    Best wishes,
    Tobias

    Thread Starter estarella

    (@traductordemenu)

    Sorry,
    I found where is the problem.
    Normaly I have in tabletools.php this:

    * Evaluate “datatables_tabletools” parameter and add corresponding JavaScript code, if needed
    */
    function tablepress_add_tabletools_js_command( $command, $html_id, $parameters, $table_id, $js_options ) {

    if ( ! $js_options[‘datatables_tabletools’] )
    return $command;

    $table_wrapper = “{$html_id}_wrapper”;
    $html_id = str_replace( ‘-‘, ‘_’, $html_id );
    $table_name = “oTable_{$html_id}”;
    $tabletools_name = “oTableTools_{$html_id}”;
    $command = substr( $command, 0, -1 ); // removing ; at the end
    $swf_path = plugins_url( ‘swf/copy_csv_xls_pdf.swf’, __FILE__ );
    // with text (somme CSS needs to commented out!):
    //$tabletools_options = ‘{ “sSwfPath”: “‘ . $swf_path . ‘”, “aButtons”: [ “copy”, “print”, { “sExtends”: “collection”, “sButtonText”: “Save as”, “aButtons”: [ “csv”, “xls”, “pdf” ] } ] }’;
    // with images:
    $tabletools_options = ‘{ “sSwfPath”: “‘ . $swf_path . ‘”, “sRowSelect”: “multi”, “aButtons”: [ { “sExtends”: “copy”, “sButtonText”: “”, “bSelectedOnly”: true, “mColumns”: “visible”}, { “sExtends”: “xls”, “sButtonText”: “”, “bSelectedOnly”: true, “mColumns”: “visible” }, { “sExtends”: “xls”, “sButtonText”: “”, “bSelectedOnly”: true, “mColumns”: “visible”, }, { “sExtends”: “pdf”, “sButtonText”: “”, “bSelectedOnly”: true, “mColumns”: “visible”, “sPdfOrientation”: “landscape”, }, { “sExtends”: “print”, “bShowAll”: false, “sButtonText”: “”, “bSelectedOnly”: true, “sPrintOrientation”: “landscape”, } ] }’;

    $command = “var {$table_name} = {$command}, {$tabletools_name} = new TableTools({$table_name}, {$tabletools_options}); $(‘#{$table_wrapper}’).before({$tabletools_name}.dom.container);”;
    return $command;
    }

    How can I aply now “bSelectedOnly”: true and “sRowSelect”: “multi”

    Thanks!!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    from what I can see, what you did there in the code looks correct.
    But as mentioned above, I’m not that familiar with the actual JS code, so you could maybe check the output (“View source” in the browser), and the JS error log console in the browser.

    Regards,
    Tobias

    Thread Starter estarella

    (@traductordemenu)

    ok, i try
    ??

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    sounds good! I hope that you can find a good solution!

    Best wishes,
    Tobias

    Thread Starter estarella

    (@traductordemenu)

    I can’t try, is very dificult for me…

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    yes, it would require some custom coding :-/

    Regards,
    Tobias

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Select rows’ is closed to new replies.