Pivot Column Reorder

Hi everyone, I'm working with two tables, "Locations" and "Waypoints," that are connected through a pivot table called "location_waypoint." The pivot table includes an additional column called "sort_order." I'm looking for guidance on how to display and reorder the 'sort_order' pivot column within the "Locations" table. (1) Retrieve the 'sort_order' column from the "location_waypoint" pivot table and show it into the "Locations" table. (2) Reorder the 'sort_order' column and after reordering it should persist in pivot table. Any assistance or suggestions on achieving this would be greatly appreciated. Thank you in advance for your help!
4 Replies
Dan Harrin
Dan Harrin2y ago
is it a relation manager
Dhruva
DhruvaOP2y ago
I am using standalone table builder and form builder package
Dan Harrin
Dan Harrin2y ago
please check out the relation manager class from the admin panel it will show you how to replace getTableQuery() with getRelationship() and getInverseRelationship() you need the HasRelationshipTable interface too then, we should be able to recognise the pivot columns and allow you to reorder on them
Dhruva
DhruvaOP2y ago
Ok. Thanks
Want results from more Discord servers?
Add your server