KoolReport's Forum

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

Data table - options are ignored. #1413

Closed Larry Schultz opened this topic on on Apr 28, 2020 - 3 comments

Larry Schultz commented on Apr 28, 2020

I suspect this has something to do with not including a library or etc. I get back data but only in an unformatted (ugly) table. Options like below, including CSS are ignored.

<?php 
    use \koolreport\widgets\koolphp\Table;
    use \koolreport\amazing\Theme;
    use \koolreport\clients\Bootstrap;

?>

<div class="text-center">
    <h1>Farms Report</h1>
    <h4>This report shows farms edited this year</h4>
</div>
<hr/>

<?php
Table::create(array(
    "dataStore"=>$this->dataStore('recent_farms'),
    "options"=>array(
        "searching"=>true,
        "paging"=>true,
        "select"=>true,
        "fixedHeader"=>true),
        "showFooter"=>true,
        "serverSide"=>true,
        "columns"=>array(
            "FarmName"=>array(
                "label"=>"Farm",
                'data-search' => 'FarmName', 
            ),
            "Agency"=>array(
                "label"=>"Agency"
            ),
            "EditedOn"=>array(
                "label"=>"Last Edited On"
            ),
            
        ),
    "cssClass"=>array(
        "table"=>"table table-striped table-bordered"
    ),
    
));
?>


        </div>
    </div>
</div>
Larry Schultz commented on Apr 28, 2020

BTW, adding this to a column array does work:

"cssStyle"=>"font-weight:bold",

KoolReport commented on Apr 28, 2020

HI Larry, you should add theme to the report class file, not in the view file:

class MyReport extends \koolreport\KoolReport
{
    use \koolreport\clients\Bootstrap;
    ...
}

The same applied to use \koolreport\amazing\Theme;

Let me know if you need further assistance.

Larry Schultz commented on Apr 28, 2020

thanks for help

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

None