Skip to content

Replace data when exporting to csv or xlsx #1519

Answered by dansysanalyst
OrakFR asked this question in Q&A
Discussion options

You must be logged in to vote

You can create two fields, one containing the raw data and the other containing the formatted HTML link. Let's call them raw_contact_data and html_contact_data.

Then, you then hide the column for raw_contact_data from table view and make it visible for exporting.

In addiction, you can make the column for html_contact_data visible for exporting and hidden in the table view.

For example:

Fields:

use PowerComponents\LivewirePowerGrid\Exportable;
use PowerComponents\LivewirePowerGrid\PowerGridFields;
use PowerComponents\LivewirePowerGrid\PowerGridComponent;

final class MyPowergridTable extends PowerGridComponent
{
    use WithExport;

   //....

    public function fields(): PowerGridFields

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@OrakFR
Comment options

@dansysanalyst
Comment options

Answer selected by OrakFR
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants