KoolReport's Forum

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

Datagrid complex headers not working #1900

Closed ankit raj opened this topic on on Feb 11, 2021 - 2 comments

ankit raj commented on Feb 11, 2021

Hi, i am trying to use complex header for datagrid as instructed, but it isn't working. What is going wrong since its messing up the labels of other columns also?

   \koolreport\datagrid\DataTables::create(array(
            "themeBase"=>"bs4",
            "name"=>'dummy',
            'complexHeaders' => true,
            'headerSeparator' => '-',
            "cssClass"=>array(
                "table"=>"table table-striped table-bordered ",
                "td"=>function($row, $colName) {
                   if(in_array($colName,["wk3","wk2","wk1","month3","month2","month1"]))
                        return 'number-css';
                },
            ),
            "dataSource"=>$table_array,
            "columnDefs" => array(
                array("type"=> "html-num", "targets" => [4])
            ),
            "columns"=>[
                "Region"=>['label'=>'aaa-Region'],"wk3"=>['label'=>'aaa-'.$last_to_week_text]
David Winterburn commented on Feb 12, 2021

Hi,

At the moment Datagrid's complex header only works with the column keys themselves and not the column labels. We will consider to implement complex header to work with column labels in the next versions of Datagrid. Meanwhile, you could try to rename the column keys in the complex format to make it work.

ankit raj commented on Feb 12, 2021

Thanks , I was able to implement using complex format column keys.

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

None