KoolReport's Forum

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

How to hide Column using datagrid? #516

Closed Giselle Machado opened this topic on on Nov 9, 2018 - 3 comments

G
Giselle Machado commented on Nov 9, 2018

I saw that function in the Table but not in the datagrid package.

https://www.koolreport.com/forum/topics/38

I wanna to do the same as the following

Table::create(array(
    "excludedColumns"=>array("totalqty")
))

But using DataTables, something as the following

DataTables::create(array(
    "excludedColumns"=>array("totalqty")
))

Regards, Giselle Machado.

K
KoolReport commented on Nov 13, 2018

There is the different between them, may be you may try to list all columns you need for DataTables. Or you can do this;

DataTables::create(array(
    "dataSource"=>$this->dataStore('mydata')->except('totalqty')
));

Note: You will need to upgrade to KoolReport 3.0.0

G
Giselle Machado commented on Nov 14, 2018

I solved by using

->saveTo($source); $source->pipe(new RemoveColumn(array('columnName') ->pipe($this->dataStore('result'));

and $source->pipe($this->dataStore('result2'));

So, I have two distinct results.

Thanks, Giselle Machado.

K
KoolReport commented on Nov 14, 2018

Oh that's great. it works the same.

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