How to place form actions on header actions
this is what i've tried, the problem is that when i click save in the header action save btn, it doesnt do anything
27 Replies
You mean you want a savebutton in the header of create/edit form?
Something like this
exactly
You only need to run the
save
action:
and i already have it, but when i click it, it doesnt do anything
Full example:
i use the
->submit('create')
ill try ur example now, lets seeand thats wrong
but note that im in the createrecord
is not editrecord
and that action is okay cuz if i use it inisde the
getFormActions
fn, works fineyeah. The create isn't the problem, but the submit
but when putting it inisde
getHeaderActions
doesnt
same goes for create
also i noticed that when there is an image, the one in the
getHeaderActions
is not showing the spinner with that text saying that an image is being uploaded, while the one in the getFormActions
it does
or i miss something or this doesnt work for me or something 🤔 hmmm
(and before all this, did run composer update)
okay, i miss something then hmmcopy paste your createRecord class
u can grab this one - https://discord.com/channels/883083792112300104/1184098127737798686/1184098127737798686
Yeah. But there u are using the wrong method
Use
action
instead of submit
yeah this was the issue, anyways look the buttons, look different when uploading a file. i guess that is a thing about filament
thanks for ur time again bro
Well, for this I have no solution atm. Filament is changing the state of the button automatically. No clue how to reproduce it on your header button
its fine (:
but how could i like ask to fix/make this feature so the header actions also await for a file upload to finish? u'd do it in the issues github? -> https://github.com/filamentphp/filament/issues
This will probably not get "fixed" since its not an issue.
yeah well yeah, i said fix/feature (:
but idk 🤷
id love to know how to fix it myself haha
well, i tried it now just with sleep and then there is a loading animation at least
hmm wdym just with sleep, using
sleep($seconds)
somewhere in the code?So this
thats not a solution of course, but as you can see, the button is showing the loading circles
u r right, but still doesnt show the "uploading file txt", but its fine i guess for now it is what it is, not a big problem
just wondering if the user is like, quick and just drops the file and presses submit, havent tested it. i note it to do it tomorrow