If you would like to load Scheduler events from the server during scrolling (this feature is called dynamic event loading), you need to do two things:
-
Enable this feature using dynamicLoading: true
(as you do).
-
Load the actual event data from the server (or other data source) in the onScroll
event handler.
You can find an example in the documentation:
<script>
const dp = new DayPilot.Scheduler("dp", {
dynamicLoading: true,
onScroll: async (args) => {
const start = args.viewport.start;
const end = args.viewport.end;
const {data} = await DayPilot.Http.get(`/events?start=${start}&end=${end}`);
args.events = data;
args.loaded();
),
// ...
});
dp.init();
</script>
The data loading is set to asynchronous mode by default (args.async === true
). It is necessary to call args.loaded()
when the data is available.
You can also find more complex examples in the following tutorials. They which include a server side part (ASP.NET Core or PHP) and some additional explanation and performance tips: