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:Jump to 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
2 Replies
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
thanks, owesome, I use Toggle::make('colspan')->label('full page')->live(), and ->columnSpan(fn(Get $get) => $get('colspan') ? 3 : 2), to control colspan