DayPilot.Scheduler.onScroll

This event is fired whenever the Scheduler grid scrollbar position changes (when dynamic event loading is enabled).

Parameters

  • args.viewport.start (DayPilot.Date)
  • args.viewport.end (DayPilot.Date)
  • args.viewport.resources (array of resource id strings)
  • args.async
  • args.events
  • args.loaded();

See Also

Example

    dp.dynamicLoading = true;
    dp.onScroll = function(args) {
        args.async = true;
        
        // simulating slow server-side load
        setTimeout(function() {
            
            var events = [];

            // generate 10 new events
            for (var i = 0; i < 10; i++) {
                var duration = Math.floor(Math.random() * 6) + 1; // 1 to 6
                var startOffset = Math.floor(Math.random() * 6) + 1; // 1 to 6

                var start = args.viewport.start.addDays(startOffset);
                var end = start.addDays(duration);

                var e = {
                    start: start,
                    end: end,
                    id: DayPilot.guid(),
                    resource: "A",
                    text: "Event"
                };
                
                events.push(e);
            }
        
            args.events = events;
            args.loaded();
        }, 500);        
    };

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java