# What's new in Scheduler v5.2.0

## New widget for switching views
The [ViewPresetCombo](#Scheduler/widget/ViewPresetCombo) is an easy-to-setup preset picker which can be added to the 
Scheduler's toolbar and provides a simple UI for switching between different "views". It's based on 
[ViewPreset](#Scheduler/preset/ViewPreset) which is built-in to the Scheduler.

Try it out in the live demo here:

<div class="external-example" data-file="./data/Scheduler/examples/widget/ViewPresetCombo.js"></div>

## Selecting time spans in the timeline header

Scheduler has a new feature called `TimeSelection`, which allows you to select custom time spans in the timeline header.
Can for example be used to select events intersecting that time span or to highlight resources available during the time
span. Try it out in the new `time-selection` demo, or in the live demo below:

<div class="external-example" data-file="Scheduler/feature/TimeSelection.js"></div>

## Virtualized time range rendering

The `TimeRanges` feature was refactored to support virtualization, it now only renders lines and ranges in view. This
also applies to the `NonWorkingTime` feature, and will boost rendering performance on long time axes when either
feature is used.

The demo below spans 50 years. Previously it would render 50 * 52 = 2600 non-working-time elements to the DOM, but now
it renders much fewer:

<div class="external-example" data-file="Scheduler/guides/whats-new/5.2.0/nonworkingtime.js"></div>

## EventNonWorkingTime feature

The `NonWorkingTime` feature has a new sibling feature called `EventNonWorkingTime`, that renders the non-working time 
ranges (weekends) as shaded parts of the event bars. 

<div class="external-example" data-file="Scheduler/feature/EventNonWorkingTime.js"></div>

While the feature works well in Scheduler, it is even more useful in Scheduler Pro where events and resources can have
different calendars.

## Support for tree grouping

The `TreeGroup` feature was added in 5.0. It can transform a tree structure to give another view on the data, based on a 
set of fields or functions. In the initial release it did not work for Scheduler, it was specifically tailored for Grid 
and Gant. In this release it has been reworked to improve its functionality in Gantt, and as a bonus the changes also 
allows it to be used in Scheduler. There is a new `tree-grouping` demo showing how it works. 

<div class="external-example" data-file="Scheduler/guides/whats-new/5.2.0/treegroup.js"></div>

## Improved PDF Export feature

Pdf Export feature now renders exported content directly and does not scroll the view anymore. This significantly
improves performance (by an order of magnitude) and robustness of the export process. You can enable old behavior by
setting `enableDirectRendering` config on the export feature to `false`. Old behavior is deprecated and will be removed
in the next major release. Please report issues that make you disable direct rendering.


<p class="last-modified">Last modified on 2023-10-26 8:19:20</p>