How to adjust columnSpan for Relation Manager?
How do I adjust the columnSpan/columns for a Relation Manager table?
I currently have a Relation Manager appear below a resource form. I am also using SubNavgiationPosition::Start. As the Relation Manager doesn't sit within the Group/Section schema of the resource, it expands beyond resource form above.
15 Replies
if you want to show relation manager near attachements for example then you can't
The current position of the Relation Manager in my screenshot is acceptable. I just want to control the span of the Relation Manager table to be smaller in width (in accordance to the columns used by the Resource form).
Did you change your resource maxWidth?
For the panel yes, I've set maxContentWidth('Full')...
your form isn't in full width i would guess
I don't know the solution for your actual question, but do you still want "relation-manager" to display below (edit/view) form if you use sub-navigation? For me I put it out like this demo https://demo.filamentphp.com/blog/posts/1
And the UI are better IMO
Unfortunately for my use case, I need the sub-navigation to appear because I want to control canEdit on policy for users so they can't edit the ticket. Ofcourse, I can change the design and get rid of sub-navigation (use headerActions instead) and resize the forms (small headache) so that it looks right. But, seems odd that a Relation Manager which is a table and the width cannot be resized... somehow.
but your form isn't in full width now right?
I've scoped the Group/Section schema with ->columns(4). The section on the left is 3 columns wide and the sections on the right are 1 column wide.
that doesn't answer the question
I guess, the answer is 'no'.
try removing columns and i think everything will line properly
I appreciate the suggestion. However, I want the form to look as is currently (if it can be helped). I know that if I remove the columns it will align. But the form is the main working section and so I have hoped the RM can be sized to match without needing to remove the column settings.
no. table doesn't have any width config. the only way I guess would be to use custom theme
The simplest way is that I just widen the main working section from columnSpan(2) -> columnSpan(3)... this makes things align. So it's not a dealbreaker. Just that all table's width (seems to be) governed by the maxContentWidth() in AdminPanelProvider. IMO it would be good if tables can widths can be adjusted. The coding needed to do this is beyond my current skills and I can only imagine the Filament Team has a good reason for not having this adjustment configurable.
Thanks @krekas @Vp for suggestions.