How to call action from js?

I have a custom script in a custom filament page.
Inside of it, when something happens, i want to open an action.
I'm trying:
// js
mountAction('createTask')

but i get:
Uncaught ReferenceError: mountAction is not defined

this is the action, and if i click it's button, it triggers it and the modal gets opened. so i just wanna call the method that opens the action modal via js:
public function createTaskAction(): Action
{
    return Action::make('createTask')
        ->form([
            Forms\Components\TextInput::make('name'),
        ])
        ->action(function (array $arguments): void {
            dd('hi');
        })
    ;
}
Was this page helpful?