Filament Table Text Column action not firing

I have a Filament table widget, in which I do a semi complex query to fetch some grouped data:
public function table(Table $table): Table
{
return $table
->query(
$this->sql()
)
->striped()
->heading('Missing Co-Loader')
->columns([
TextColumn::make('job_operator_name')->label('Job Operator Name'),
TextColumn::make('num_jobs')->label('Total Jobs')->alignCenter()->action(
ViewAction::make('test')
->modalContent(fn (Model $model): View => view(
'filament.app.widgets.pegasus.commercial.top-stats-widget',
[
'model' => $model,
],
))
)
]);
}

protected function sql()
{
return ReportShipment::query()
->select(
DB::raw('ROW_NUMBER() OVER (ORDER BY COUNT(id) DESC) as id'),
'job_operator_name',
DB::raw('COUNT(id) as num_jobs')
)
->where('consol_type', 'CLD')
->whereNull('consol_co_loaded_with_code')
->groupBy('job_operator_name')
->orderByDesc('num_jobs');

}

public function getTableRecordKey($record): string
{
$name = str_replace(' ', '_', $record->job_operator_name);
return 'missing_co_loader_widget_'.$name;
}
public function table(Table $table): Table
{
return $table
->query(
$this->sql()
)
->striped()
->heading('Missing Co-Loader')
->columns([
TextColumn::make('job_operator_name')->label('Job Operator Name'),
TextColumn::make('num_jobs')->label('Total Jobs')->alignCenter()->action(
ViewAction::make('test')
->modalContent(fn (Model $model): View => view(
'filament.app.widgets.pegasus.commercial.top-stats-widget',
[
'model' => $model,
],
))
)
]);
}

protected function sql()
{
return ReportShipment::query()
->select(
DB::raw('ROW_NUMBER() OVER (ORDER BY COUNT(id) DESC) as id'),
'job_operator_name',
DB::raw('COUNT(id) as num_jobs')
)
->where('consol_type', 'CLD')
->whereNull('consol_co_loaded_with_code')
->groupBy('job_operator_name')
->orderByDesc('num_jobs');

}

public function getTableRecordKey($record): string
{
$name = str_replace(' ', '_', $record->job_operator_name);
return 'missing_co_loader_widget_'.$name;
}
This will yield a table like this:
|Job Operator Name| Total Jobs |
--------------------------------
|Name A | 5 |
|Name B | 15 |
...
|Job Operator Name| Total Jobs |
--------------------------------
|Name A | 5 |
|Name B | 15 |
...
And the number in the Total Jobs column will be clickable. However, when I click the number, nothing happens. If I check the console -> network requests, I see that an update request is indeed sent, but still - nothing happens. I would expect the action to open a modal, with the content from my custom blade view. What am I doing wrong?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server