Hi Team,
We have a requirement to highlight the task in the scheduler as an action from data shown in the bryntum-grid UI. For same day tasks it is scrolling to the event/resource and the highlight is wokring as expected. But below cases are failing while scrolling to the respective task.
CASE 1:
we have a long running task, e.g. the start date is 25th March, 2025 and end date is 9th April, 2025, then instead of scrolling to the event on current date it is highlighting the event on some middle date like 4th April, 2025.
CASE : 2
Also. if the long running task is in the past (start date : 2nd Feb, 2025, end Date : 25th March, 2025), then we are trying to scroll to the start date of the task but in the process the timeline is vanishing.
The code tried -
Approach 1
let eventRecord: any = this.schedulerComponent.instance.eventStore.getById(selectedEvent.id)
let resourceRecord: any = this.schedulerComponent.instance.resourceStore.getById(crewid)
await this.schedulerComponent.instance.scrollEventIntoView(eventRecord)
let crewElement = this.schedulerComponent?.instance?.getElementFromEventRecord(eventRecord, resourceRecord)
if (crewElement) {
crewElement.scrollIntoView({ behavior: "smooth", block: "center" });
}
//followed by the css change for applying blinking effect on highlight
Approach 2
//trying to use buffer hours to set the time span corectly
let eventRecord: any = this.schedulerComponent.instance.eventStore.getById(selectedEvent.id)
let newDate = new Date(eventRecord.data.startDate)
let endDate = new Date(eventRecord.data.startDate)
endDate.setHours(endDate.getHours() + 5 + 2)
instance.timeAxis.setTimeSpan(newDate, endDate)
setTimeout(async () =>{
let dateX = instance.getCoordinateFromDate(eventRecord.data.startDate)
await instance.scrollable.scrollTo(dateX, null, { animate: true })
instance.scrollRowIntoView(crewid)
},50)
Please, could you help us with this.
Bryntum Gantt version: 5.6.8
Angular version : 17
PFA - recording (the green background task shown in the recording is a long running task and is ending for the current date i.e. 9th April, 2025 and starting on 25th Marhc, 2025.)