dynamic colspan for resource form

Hi, I wonder is there any dynamic way to set form colspan, the scenario is like we have 2 or 3 column form and when we click a button/action the colspan become 1, it would be usefull if we use Richtext for editing the content
Solution:
hidden field with default value, then fn($get) => $get('hidden_field') in the colspan and get the hidden field value. then in the action set the hidden field value
Jump to solution
2 Replies
Solution
toeknee
toeknee5mo ago
hidden field with default value, then fn($get) => $get('hidden_field') in the colspan and get the hidden field value. then in the action set the hidden field value
abanghendri
abanghendriOP5mo ago
thanks, owesome, I use Toggle::make('colspan')->label('full page')->live(), and ->columnSpan(fn(Get $get) => $get('colspan') ? 3 : 2), to control colspan
Want results from more Discord servers?
Add your server