Replies: 1 comment 1 reply
-
|
I had this issue as well. The order of the I looked at Filament's public function getCachedColumns(): array
{
return $this->cachedColumns ??= array_reduce(static::getColumns(), function (array $carry, ExportColumn $column): array {
$carry[$column->getName()] = $column->exporter($this);
return $carry;
}, []);
}It is the column's name that is the key in the associative array built here. So I wondered if there was a bug deeper in code and somehow it was exporting the columns in alphabetical order using name or something. I am new to Filament so I have not figured that out yet. But I was able to get my 5 columns in the order I wanted by changing the columns name and then just using the state() function. Before: ExportColumn::make('user.email')
->label('Email'),After: ExportColumn::make('email')
->label('Email')
->state(fn (User $user): string => user->email), |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Package
Table builder
Package Version
v3.3.14
How can we help you?
I have export columns like this :
but the result look like this :
How to fix this issue?
Beta Was this translation helpful? Give feedback.
All reactions