It is not possible to change the text of an existing active area using the Scheduler API.
The Scheduler is built on a "refresh" model - you need to update the state first and then request an update that re-renders the Scheduler (or its part). This makes the state/view synchronization easier (see also https://api.daypilot.org/daypilot-scheduler-update/).
1. First, make sure that "isExpanded" is a global variable. Do not set isExpanded = true at the beginning of onBeforeRowHeaderColumnRender.
2. In onBeforeRowHeaderColumnRender, check the isExpanded value and set the text accordingly (instead of the hard-coded '-' text).
text: isExpanded ? '-' : '+',
3. In the onClick handler, set the new isExpanded value before calling rows.expandAll()/collapseAll().
The rows.collapseAll() method will always invoke full Scheduler refresh (including the column headers).
The rows.expandAll() method is optimized and it may only update a part of the Scheduler. So it's better to replace it with this:
self.rows.all().forEach(r => r.data.expanded = false);
self.update();
That ensures the active area in the column header will be re-rendered.