https://bryntum.com/products/schedulerpro/docs/api/Scheduler/view/mixin/TimelineScroll#function-scrollToDate is async.
Try to await
before continue your code?
Support Forum
That code just won't work if you look at the docs for the APIs you use.
Just returns the offset along the time axis. So that will be just an X
position
https://bryntum.com/products/calendar/docs/api/Core/widget/Widget#function-showBy
Can you experiment with that? You might have to set a breakpoint in your code and check what it is doing.
Basically, I am not using on any Bryntum event, instead I receive date and resource ID from the API response, then I need to show the icon at that particular date and resource.
Hence, I can't make use of props.eventElement.
this.getInsertionPoint().subscribe( res => {
if (res.length > 0) {
this.schedulerPro.scrollToDate(new Date(res[0].insertionPointDateTime), { block: 'start' });
let a = this.schedulerPro.getCoordinateFromDate(res[0].insertionPointDateTime);
this.icon.cls = "arrow-cls";
this.icon.showBy({ target : props.eventElement, offset : [a] }); //this props can't be used
}
})
Hi,
Please find the attached demo code.
I have added showArrow button at the top, on clicking on the button, it should scroll to the date and to the particular resource which is specified in the showArrow().
Thanks,
Swathi
- Attachments
-
- showing-arrow.zip
- (121.85 KiB) Downloaded 8 times