如何在ZFDATAGRID中的Excel导出中显示一列,并在GRID显示中隐藏同一列


How to show a column in Excel Export in a ZFDATAGRID and hide the same column in the GRID display?

我的网格中有一个列"ID",我使用$grid->setColumnsHidden(array('id'));

但我需要报告中的"ID"列,我正在使用excel导出$grid->setExport(array('excel'));

有可能做到吗??如果是的话,请帮帮我。。。

提前感谢。。。

只有当这不是导出时,才可以使用网格的isExport()方法来隐藏ID字段:

if(!$grid->isExport()){
    $grid->setColumnsHidden(array('id'));
}