Hi, I have a many_many relationship all working
in my template I can do this
<% control group %>
$Title
<% control people %>
$Title
<% end_control %>
<% end_control %>
this lists the group, and the people that have many_many relations to the group. simple
however, I need to filter both the group dataobject and the people dataobject.
the group just needs to be lists by sorted by Title, but the people need a search filter and sort.
I can create a function 'sortGroup' and use in place of just using 'group' in the template
public function sortGroup() {
return DataObject::get('Group', '', '`Title` ASC');
}
but i'm not sure how I would then create my filtered, sorted dataobject search to find all the many_many records within each group.
any ideas much appreciated.
thanks