F
Filamentβ€’2y ago
Anom_Dkk

Disable Toggle Column by button

i have toggle column and i want to if i click the button click it will disable the toggle column, i have to tried to make function with button on livewire but its not working, this my code this my function to handle click public function lockdataTable() { $this->lockdata = !$this->lockdata; } this my code of the toggle column ToggleColumn::make('mengajukan_rpl')->label('Mengajukan RPL')->disabled($this->lockdata), i havent idea again, maybe someone can help me for fix my isue, thanks
Solution:
i have toggle column and i want to if i click the button click it will disable the toggle column, i have to tried to make function with button on livewire but its not working, this my code this my function to handle click public function lockdataTable() { $this->lockdata = !$this->lockdata;...
Jump to solution
5 Replies
Patrick Boivin
Patrick Boivinβ€’2y ago
Maybe you don't need the function, I think this can work: ->disabled(fn ($state) => $state === true)
->disabled(fn ($record) => (bool) $record->mengajukan_rpl)
->disabled(fn ($record) => (bool) $record->mengajukan_rpl)
Anom_Dkk
Anom_DkkOPβ€’2y ago
I want to setting the lock button on my page not on my database, hopefully this function lock will open next steps so if lock button not clicked the next steps can't show.
toeknee
toekneeβ€’2y ago
Just do:
->disabled(fn($state) => (bool) $state)
->disabled(fn($state) => (bool) $state)
Patrick Boivin
Patrick Boivinβ€’2y ago
I think $state is not injected in the disabled() callback of a column What are the "next steps"? Do you have a form with a Wizard on the same page or something?
Anom_Dkk
Anom_DkkOPβ€’2y ago
Thanks for answered my question, actually I have solution for handle that. Thank you very much for responded 😊.
Want results from more Discord servers?
Add your server