현수
현수
FFilament
Created by 현수 on 11/19/2023 in #❓┊help
How do I add modal action to TableWidget like Resource?
I can open the modal window with the code below in the resource
class UserResource extends Resource
{
public static function table(Table $table): Table
{
return $table
// columns, filters...
->actions([
Tables\Actions\Action::make('testAction')
->form([
TextInput::make('testField')
]),
]);
}
}
class UserResource extends Resource
{
public static function table(Table $table): Table
{
return $table
// columns, filters...
->actions([
Tables\Actions\Action::make('testAction')
->form([
TextInput::make('testField')
]),
]);
}
}
But I can't open modals with the code below in the table widget
use Filament\Widgets\TableWidget as BaseWidget;
class MyTableWidget extends BaseWidget
{
public function table(Table $table): Table
{
return $table
->query(MyModel::query())
// columns...
->actions([
Tables\Actions\Action::make('testAction')
->form([
TextInput::make('testField')
]),
]);
}
}
use Filament\Widgets\TableWidget as BaseWidget;
class MyTableWidget extends BaseWidget
{
public function table(Table $table): Table
{
return $table
->query(MyModel::query())
// columns...
->actions([
Tables\Actions\Action::make('testAction')
->form([
TextInput::make('testField')
]),
]);
}
}
I probably don't know much about the difference between Row action and basic action.......... Please let me know if there is a way to launch the modal window in TableWidget
3 replies