How to find the current view when the Scheduler is rendered with same views with different intervals in JS?
This knowledge base article explains the way to find the current view when the Scheduler is rendered with same views with different intervals.
Step 1: Create a JS Scheduler by referring the following online sample link.
https://ej2.syncfusion.com/javascript/demos/#/material/schedule/extended-views.html
Step 2: Render the Day view with 3 different intervals as shown in the following code example.
views: [ { displayName: '1 Day', option: 'Day', interval: 1 }, { displayName: '5 Days', option: 'Day', interval: 5 }, { displayName: '10 Days', option: 'Day', interval: 10 } ]
Step 3: Bind navigating event to get the clicked view name as shown in the following code example.
navigating: function (args) { alert('Clicked view is ' + this.views[args.viewIndex].displayName); }
Step 4: Run the sample, once the view button is selected, view name will be displayed as shown below.
Figure 1: Displaying clicked view name.
Please refer the example from the following GitHub link.
Example – Get clicked view name
Conclusion
I hope you enjoyed learning about how to find the current view when the Scheduler is rendered with same views with different intervals.
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!