The groups.all() method returns an array with all concurrent event groups for the Scheduler row.
DayPilot.Row.groups.all();
An array of group objects. The group object has expand() and collapse() methods which let you change the group state.
const groups = dp.rows.find("A1").groups.all();