I have a user grid it has got a column (status) which is a dynamically created html based on another model value .When trying to export the columns as listed in the grid ,is there anyway to check the model value and set the specified column dynamically. The column 'status; has not saved in the database. Tried the following
$grid->export(function ($export) {
$export->filename('Filename.csv');
$export->column('status', function ($value, $original) {
// currently $value = 'html tag' and $original is empty
$value = $this->status_flg === '1' ? 'Opened' :'Closed'; //Not working.
return $value;
});
});
In the above code i could not access the model value status_flg .