Open gray-penguin opened 2 years ago
Going off a suggestion in another issue, I used this in my controller:
public function getExportResultsSet() { return $this->mapCallbacks( $this->getQuery()->when(count($this->selected), function ($query) { return $query->havingRaw('checkbox_attribute IN (' . implode(',', $this->selected) . ')'); })->get(), true )->map(function ($item) { return collect($this->columns())->reject(function ($value, $key) { // changed below to have all table columns included in the export even if it is hidden //return $value->preventExport == true || $value->hidden == true; return $value->preventExport == true; })->mapWithKeys(function ($value, $key) use ($item) { return [$value->label ?? $value->name => $item->{$value->name}]; })->all(); }); }
I also need this answer. Do you manage to know it?
Hide/Show Columns makes no changes to the exported columns. Am I missing something?