How to show alert messages in the JavaScript Scheduler when resource data is empty?
The following steps used to show the alert message in Javascript Schedule component when resource data is empty.
Step 3: Follow the Getting Started documentation of the Toast component to show an alert message.
[index.ts]
let toastObjReminder: Toast = new Toast({ cssClass: 'e-schedule-reminder e-toast-info', position: { X: 'Right', Y: 'Top' }, showCloseButton: true, target: '.e-schedule', animation: { hide: { effect: 'SlideRightOut' }, show: { effect: 'SlideRightIn' }, }, }); toastObjReminder.appendTo('#schedule-reminder'); let scheduleObj: Schedule = new Schedule({ .......... resources: [ { dataSource: [ // Datasource as empty ], }, ], created: OnCreate, }); scheduleObj.appendTo('#Schedule'); function OnCreate(): void { if (this.resources[0].dataSource.length == 0) { toastObjReminder.show({ title: 'Resource Datasource', content: 'No Resources found', }); } } |
Sample: To-show-alert-message
Conclusion
I hope you enjoyed learning about how to show alert messages in the JavaScript Scheduler when resource data is empty.
You can refer to our JavaScript Scheduler feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Scheduler example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!