KoolReport's Forum

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

Reading data from sparkline for filtering #768

Closed iRiyada opened this topic on on Mar 30, 2019 - 3 comments

iRiyada commented on Mar 30, 2019

While creating datatable, one column value was taken and represented as sparkline. But I would like to filter that column using its value. Since the representation is that of sparkline, filtering is returning no value.

The sparkline representation using column value in datatable

"completion_percent" => array(
    
                 "label" => "نسبة الإنجاز",
                  
                 "cssStyle"=>"white-space:nowrap",
                 'formatValue' => function($val, $row) {
                    $data = $val;
                    return sparklines\Bullet::create(array(
                        "data" =>array($data,100),
                        "options"=>array(
                            "performanceColor"=>"#0f0",
                            "targetColor"=>"#f00",
                        )
                    ));
                    
                        
                    
                }

I have an input select box to choose the filter value. How to use the value in $data(from datatable column) to get the filtered results.

A snapshot of datatable

KoolReport commented on Mar 31, 2019

May be you should make a copy of comletion_percent and then adding it to the DataTables, however you hide that column on the DataTables

iRiyada commented on Mar 31, 2019

How to hide a column? tried this.but dint work


 "options"=>array(
    "columnDefs"=>array(
        array("targets"=> 10,"visible"=> false),
    )
)   
iRiyada commented on Apr 1, 2019

Thanks for the column hiding idea. It worked.

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
None yet

None