https://bryntum.com/products/schedulerpro/docs/api/Scheduler/view/mixin/TimelineScroll#function-scrollToDate is async.
Try to await
before continue your code?
Support Forum
All the best,
Alex Lazarev
How to ask for help? Please read our Support Policy
We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services
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.
Hi,
ShowByPoint
won't work for widget. Please use this way
let a = this.schedulerPro.getCoordinateFromDate('someDate');
this.icon.showBy({ target : props.eventElement, offset : [a] });
Best regards,
Tasnim
How to ask for help? Please read our Support Policy
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,
Then you can try something like this
const xy = scheduler.getCoordinateFromDate(props.date);
icon.hidden = false;
icon.x = xy;
Please let us know if that works for you.
Best of luck ,
Tasnim
Best regards,
Tasnim
How to ask for help? Please read our Support Policy
Hi,
Could you please share a runnable test case so we can check the code and give you a proper solution?
Best regards,
Tasnim
How to ask for help? Please read our Support Policy
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 38 times
Hi,
I've updated your demo and it's now working. All it needed is that a higher z-index and needed to use the getCoordinate method like this
this.schedulerPro.getCoordinateFromDate(date, false);
Please find the updated demo attached
Best regards,
Tasnim
Best regards,
Tasnim
How to ask for help? Please read our Support Policy