KoolReport's Forum

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

Datagrid datatable footer passing an array #1424

Closed ankit raj opened this topic on on May 6, 2020 - 1 comments

ankit raj commented on May 6, 2020

Hello , i am using datatable package and wanted to know how to pass footer array explicitly or just let it take last row as footer , i am fine with both: This is the code right now:

\koolreport\datagrid\DataTables::create(array(
            "themeBase"=>"bs4",
            "dataSource"=>$table_array,

            'cssClass'=>array(
                'th' => 'reportHeader',

            ),
            "options"=>array(
                "showFooter"=>true,
                "order" => [],

            )
        ));
KoolReport commented on May 7, 2020

You do this:

DataTables::create([
    ...
    "showFooter"=>true,
    "columns"=>[
        "myColumnName"=>[
            "footerText"=>$this->dataStore("myStore")->last()["myColumnName"]
        ],
        ...
    ]
]);

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
solved

DataGrid