You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is because the column's formatState() method (and therefore formatStateUsing() for me) gets called, supplying the Model, not the Collection. This is due to the @foreach loop inside text-column.blade.php of Filament:
Not sure the best approach to take here, because not all columns have this array-wrapping behaviour, only TextColumns. In this package, the type of column is not a property of pxlrbt\FilamentExcel\Columns\Column and therefore a conditional check for the type of column (if originating from the table) is not possible.
@pxlrbt what approach would you like to take here (if at all)? Happy to attempt a PR. 😀
The text was updated successfully, but these errors were encountered:
With v3, a
TextColumn
can render badges. This can be multiple badges in the one cell if the state of the column is anarray
orCollection
.In my case, I have
Tag
models, with a name and colour attribute.The following works in the resource table but not when exporting:
The reason is because the column's
formatState()
method (and thereforeformatStateUsing()
for me) gets called, supplying theModel
, not theCollection
. This is due to the@foreach
loop insidetext-column.blade.php
of Filament:https://github.com/filamentphp/filament/blob/f1c299b36fcabf9f7c602bbf10b08df8137dc3a6/packages/tables/resources/views/columns/text-column.blade.php#L18-L37
Not sure the best approach to take here, because not all columns have this array-wrapping behaviour, only
TextColumns
. In this package, the type of column is not a property ofpxlrbt\FilamentExcel\Columns\Column
and therefore a conditional check for the type of column (if originating from the table) is not possible.@pxlrbt what approach would you like to take here (if at all)? Happy to attempt a PR. 😀
The text was updated successfully, but these errors were encountered: