0

I have a column 'ID' in my grid, i am hiding that column from the data grid using $grid->setColumnsHidden(array('id'));

But I need that 'ID' column in my report, I am doing an excel export using $grid->setExport(array('excel'));

Is it possible to do that?? If so please help me out here...

Thanks in advance...

1 Answers1

0

You can use the isExport() method of the grid to hide the ID Field only if this is not an export:

if(!$grid->isExport()){
    $grid->setColumnsHidden(array('id'));
}
honk
  • 9,137
  • 11
  • 75
  • 83
Bhaskar
  • 28
  • 8