How to expose table of ManageRelatedRecords to widget
I have a Widget that i'm displaying in the header of a ManageRelatedRecords page, from the widget i want to get access to the table, i used the trait on the ManageRelatedRecords page and i put that page inside the getTablePage of the widget and i'm getting this error: it works fine if in the getTablePage i put a ListRecords class instead of a ManageRelatedRecords, but in my case it's manage related records page, so how can i do that ? and another problem is trying to get the owner record of the ManageRelatedRecords from the widget, right now i'm passing it as a parameter for the make in the getHeader but i don't know if that's ideal
3 Replies
@Milorn did you find away ?
Oh i thought this was an old question just now notice it was one hour , sorry
@Samer Still on it
I'm using a hack for now, i created a ListRecords class just for this purpose
And put inside the table that i wanted
And i return it from getTablePage in the widget
thanks
inside the ListRecords class i just put this
protected static string $relationship = 'Profiles';
then in the widget i use
$profile = $this->getPageTableQuery()->getRelation('profiles')->count();