datagrid icon indicating copy to clipboard operation
datagrid copied to clipboard

Export callback and replaced values

Open BigOHenry opened this issue 6 years ago • 1 comments
trafficstars

Hello, i have custom export callback and i want to export as is data from datagrid. When i am using custom export callback i am able get data as is from database without applied renders, replacements, etc..

Is there any way how to get datagrid data with "translated" data?

Or i have to again mannualy replace values in export?

BigOHenry avatar Dec 05 '18 13:12 BigOHenry

@BigOHenry I think you can define columns separately and then use them in both datagrid and the callback:

$column = new ColumnText($grid, 'name', 'name', 'Name');

$grid->addColumn($column);

$grid->addExportCallback(..)->setColumns([setColumns]);

But this is not usable right now. Method DataGrid::addColumn() is protected. Also, the notation new ColumnText($grid, 'name', 'name', 'Name') is now really stupid, it would be cool to refactor this code a bit and make it more simple.

paveljanda avatar Sep 19 '19 13:09 paveljanda