[3.x] Add CSV Export Options: Separator & Delimiter
⚡ PowerGrid ⚡ Pull Request
Welcome and thank you for your interest in contributing to our project!. You must use this template to submit a Pull Request or it will not be accepted.
💡 Please complete this template to submit a Pull Request, we cannot accept incomplete Pull Requests.
Guidelines
🗒️ Please read the Contributing Guide and follow all steps listed there.
✍️ Give this PR a meaningful title.
📣 Describe your PR details below.
Pull Request Information
Motivation
- [ ] Bug fix
- [X] New feature
- [ ] Breaking change
Related Issue(s)
This PR Fixes the Issue https://github.com/Power-Components/livewire-powergrid/issues/623.
Description
This Pull Request adds the possibility to set the separator and field delimiter when exporting to CSV.
public function setUp(): array
{
$this->showCheckBox();
return [
Exportable::make('export')
->csvSeparator('|')
->csvDelimiter('@')
->type(Exportable::TYPE_CSV),
];
}
Resulting in:
ID|Prato
1|@Pastel de Nata@
Instead of the default:
ID,Prato
1,"Pastel de Nata"
This can be useful if the CSV exported by PowerGrid will be imported in some other software with different requirements.
Contribution Guide
- [X] I have read and followed the steps listed in the Contributing Guide.
Documentation
This PR requires Documentation update?
- [ ] Yes
- [ ] No
- [X] I have already submitted a Documentation pull request.
DOC PR: https://github.com/Power-Components/powergrid-doc/pull/51