Hi,
I want to show arrow on click of the button at specific location with the date and time specified (refer below screenshot)
Thanks,
Swathi
Hi,
You can create a widget for the arrow icon
const widget = new Widget({
appendTo : 'container',
style : 'position:absolute; font-size: 5rem',
hidden : true,
positioned : true,
html : '<i class="b-fa-solid b-fa-arrow-down"></i>'
});
Then you can listen for the event click to show the widget
scheduler.on('eventClick', (props) => {
widget.showBy({ target : props.eventElement, align : 't0-b0' });
});
To show it in the correct place you'd need to play with the alignspec https://bryntum.com/products/scheduler/docs/api/Core/widget/Widget#function-showBy
https://bryntum.com/products/scheduler/docs/api/Core/widget/Widget#typedef-AlignSpec
Best regards,
Tasnim
Sure, Please download the attached angular app. You can run it with npm i
& npm start
Best regards,
Tasnim
Hi Tasnim,
Thanks for the demo.
Not getting the arrow on the event click. I am following the steps what you added in the above demo. Still not working.
Not sure where I am going wrong. Can you please help me in resolving this?
Also, I need to show at some specific date, not at any event.
I am not able to attach the zip file. Hence adding the code.
app.component.ts
@Component({
selector : 'app-root',
templateUrl : './app.component.html',
styleUrls : ['./app.component.scss'],
encapsulation : ViewEncapsulation.None
})
export class AppComponent implements AfterViewInit {
@ViewChild(BryntumSchedulerProComponent) schedulerProComponent!: BryntumSchedulerProComponent;
@ViewChild(BryntumSchedulerProProjectModelComponent) schedulerProProjectComponent!: BryntumSchedulerProProjectModelComponent;
private schedulerPro!: SchedulerPro;
private project!: ProjectModel;
private icon!: Widget;
schedulerProProps = schedulerProProps;
projectProps = projectProps;
html = '<i>↓</i>';
@ViewChild(BryntumWidgetComponent, { static : true }) widgetComponent!: BryntumWidgetComponent;
ngAfterViewInit(): void {
// SchedulerPro and Project instance
this.schedulerPro = this.schedulerProComponent.instance;
this.project = this.schedulerProProjectComponent.instance;
this.icon = this.widgetComponent.instance;
this.schedulerPro.zoomToLevel(7);
this.schedulerPro.on('eventClick', (props: any) => {
this.icon.showBy({ target : props.eventElement, align : 't0-b0' });
});
}
}
app.component.html
<bryntum-widget
#widget
[positioned] = "true"
[html] = "html"
[hidden] = "true"
[style] = "'font-size:5rem; z-index: 9999'"
/>
<bryntum-scheduler-pro-project-model
#project
[resourceModelClass]="projectProps.resourceModelClass!"
[events]="projectProps.events!"
[resources]="projectProps.resources!"
[assignments]="projectProps.assignments!"
[dependencies]="projectProps.dependencies!">
</bryntum-scheduler-pro-project-model>
<bryntum-scheduler-pro
#schedulerPro
[preserveScrollOnDatasetChange] = true
[project]="project!"
[startDate]="schedulerProProps.startDate!"
[endDate]="schedulerProProps.endDate!"
[viewPreset]="schedulerProProps.viewPreset!"
[forceFit]="schedulerProProps.forceFit!"
[columns]="schedulerProProps.columns!"
[resources]="schedulerProProps.resources!"
[events]="schedulerProProps.events!"
(onScheduleContextMenu)="onScheduleContextMenuClick($event)"
[assignments]="schedulerProProps.assignments!"
[dependencies]="schedulerProProps.dependencies!">
</bryntum-scheduler-pro>
Thanks,
Swathi
Hi,
The code looks correct to me. we'd need to debug your app to know what's the issue and the solution! If you're not comfortable sharing your app here in forum, you can share it privately with us at support@bryntum.com
Best of luck ,
Tasnim
Hi,
I was facing problem with attaching the folder.
Please find the attached folder.
Thanks,
Swathi