F
Filamentβ€’16mo ago
andries

Summariser showing related data in group

We are trying to show a table of order lines, and use the group feature to group them by order_id. Ideally we would be able to show data from the related order, and we would be able to specify a custom view / component So we would have: =================== Order header Order 1 : status Order 1 : date ---------------------- Orderline 1: quantity Orderline 1: amount ---------------------- Orderline 2: quantity Orderline 2: amount =================== Order header Order 2 : status Order 2 : date ---------------------- Orderline 1: quantity Orderline 1: amount ---------------------- Orderline 2: quantity Orderline 2: amount Can this be achieved?
Solution:
Ahh, you probably want multiple tables instead then I suspect?
Jump to solution
8 Replies
toeknee
toekneeβ€’16mo ago
Look at the grouping by relationship, i believe it is achievable
andries
andriesOPβ€’16mo ago
thanks for the quick reply. I tried it, and "it works", but not exactly as we want. We would like to define multiple columns to display in the group, and even custom actions (like: change status etc).
Solution
toeknee
toekneeβ€’16mo ago
Ahh, you probably want multiple tables instead then I suspect?
andries
andriesOPβ€’16mo ago
yes but paginated "multiple tables" where the pagination should be on order level. So show order 1 -> 10 with orderlines, show order 11 -> 20 with orderlines etc. Is this possible? I have actually even no clue how this could ever work. anyway, I could understand this is out of scope, in that case we will show the list of orders, and a details modal (but it would have been nice if the above would be possible) or actually now that I think about it, it could be a table base on orders, with a custom column... that show a table of the orderlines πŸ™‚
andries
andriesOPβ€’16mo ago
getting somewhere πŸ™‚
andries
andriesOPβ€’16mo ago
andries
andriesOPβ€’16mo ago
I think this is what I want πŸ™‚ So my solution was to base the table on the parent table (orders) and have a panel that renders a custom "orderlines" component. Important to know is to adapt your query in your OrderResource, so that it already contains the orderlines.
Want results from more Discord servers?
Add your server