Skip to content

Ignore column on export #1518

Answered by dansysanalyst
OrakFR asked this question in Q&A
Apr 25, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @OrakFR,

You can use visibleInExport.

For example:

//MyPowergridTable.php

 public function columns(): array
 {
    return [
        Column::make('ID', 'id')
            ->searchable()
            ->visibleInExport(false) //Hide in export
            ->sortable(),

        Column::make('Name', 'name')
            ->searchable()
            ->hidden()
            ->visibleInExport(true)  //Show in export
            ->sortable(),

        Column::make('Created At', 'created_at_formatted') // By default, shows in export.
    ];
  }

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@OrakFR
Comment options

Answer selected by OrakFR
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