KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

DataTables - Export rowDetailData to CSV #1975

Closed Andre Van Der Walt opened this topic on on Mar 17, 2021 - 3 comments

Andre Van Der Walt commented on Mar 17, 2021

Hi,

Kindly assist on how to export rowDetailData (child rows) from DataTables to CSV using "plugins" => ["Buttons"]. Currently only visible columns are exported.

Thank you,

Sebastian Morales commented on Mar 18, 2021

Andre, pls set the detail column as visible = false and use "rowDetailData" as a client side function like this:

    DataTables::create(array(
        ...
        "columns" => array(
            "orderDate" => ['visible' => false],
            ...
        ),
        "rowDetailData" => "function(row) {
            return 'Client-built row detail: ' + row.orderDate;
        }",

When you export the table with Buttons' CSV the detail column should be there. Rgds,

KoolReport commented on Mar 19, 2021

If you are using Dashboard then the settings of DataTables will be put into settings() function of KWidget.

Andre Van Der Walt commented on Apr 9, 2021

Very nice thank you!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

DataGrid