Hi!
We are building a single day scheduler starting from 00:00 and ending at 23:59.
We would like to display the timeline view in order to show the first event of the day on page open. Now the view starts at midnight.
We are trying to use the ScrollTo (and its variants) method to move the active view to the first event (which is a given time in the day, hours and minutes), but we are unable to make it work.
We tried both with the scrollToResource method (although it seems to be made for moving to particular rows and not cells on the X axis) and with the setScrollX methods. No luck with both of them.
Can you have a look at the code to check if we are making any mistakes?
Thanks!
const dp = new DayPilot.Scheduler("dp", {
startDate: '2020-09-27T00:00:00',
cellWidth: 40,
days: 1,
cellDuration: 15,
scale: "CellDuration",
timeFormat: "Clock24Hours",
timeHeaders: [
{groupBy: "Day", format: "dddd, dd MMMM yyyy"},
{groupBy: "Hour"},
{groupBy: "Cell"}
],
showCurrentTime: true,
showToolTip: false,
eventMovingStartEndEnabled: false,
eventMoveToPosition: false,
eventResizingStartEndEnabled: false,
timeRangeSelectingStartEndEnabled: false,
allowEventOverlap: true,
eventHoverHandling: false,
eventResizeHandling: "Disabled",
eventRightClickHandling: "Disabled",
eventMoveHandling: "Disabled",
heightSpec: "Auto",
treeEnabled: true,
treePreventParentUsage: true,
rowHeaderColumns: [{text: 'Zona',display: "name"},{text: 'Posti',display: "seats"}],
});
dp.init();
dp.rows.load("backend/api/timeline/zone");
dp.events.load("backend/api/timeline/events", function (){
console.log('COMPLETED');
// Not Working
dp.scrollTo('2020-09-27T15:00:00');
});
// Not Working
dp.scrollTo('2020-09-27T15:00:00');
// Not Working
dp.setScrollX(400);
Thanks!