datagrid
datagrid copied to clipboard
Export callback and replaced values
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 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.