Skip to content

Export fails with TextColumn::make()->numeric() in Filament v4 (The column [x] is not mounted to a table) #234

@Ali-Maghari

Description

@Ali-Maghari

Hi 👋
I’m running into an issue when trying to export a Filament v4 table that contains a numeric column defined like this:

in my UsersTable.php

TextColumn::make('age')
    ->label(__('dashboard.labels.age'))
    ->suffix(' ' . __('dashboard.labels.year'))
    ->placeholder(__('dashboard.default_values.not_typed_yet'))
    ->numeric()
    ->sortable()
    ->toggleable(isToggledHiddenByDefault: false),

/**
....
*/

ExportBulkAction::make()->exports([
    ExcelExport::make('table')->fromTable()->askForFilename(label: __('dashboard.labels.exported_file_name'))
        ->askForWriterType(label: __('dashboard.labels.exported_file_type')),
]),

And after I try to export I got this error: The column [age] is not mounted to a table.

Steps to reproduce

  1. Create a resource table with a TextColumn using ->numeric().
  2. Add an ExportBulkAction with ExcelExport::make()->fromTable().
  3. Try to export — error occurs.
  4. Removing ->numeric() makes the export work again.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions