KoolReport's Forum

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

Datatables: multiple rows per record #2196

Closed Stephen Bunt opened this topic on on Jul 9, 2021 - 2 comments

Stephen Bunt commented on Jul 9, 2021

Is it possible to have multiple rows per for each record? Similar to RowDetailData but without the expand/collapse. What the second row always being displayed.

Sebastian Morales commented on Jul 12, 2021

It's a pity DataTables hasn't had this option yet but we could work around it with js function like this:

DataTables::create(array(
        "name" => "rowDetailTable", // must have a name to be used below
        ...
        "rowDetailData" => ...,
        "onReady" => "function() {
            document.querySelectorAll('#rowDetailTable_wrapper .fa-plus-square')
            .forEach(function(expandIcon) {
                expandIcon.click();
            }); // expand all row details
            rowDetailTable.column(0).visible(false); // hide the expand/collapse detail column
        }"
    )); 

Let us know if it works for you or not. Tks,

Stephen Bunt commented on Jul 13, 2021

Wile E. Coyote : Genius!

Worked like a charm. Thanks bunches.

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
solved

DataGrid