JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › General Discussions › Scheduler delete button in a repeat event
Tagged: Scheduler
- This topic has 8 replies, 2 voices, and was last updated 3 years, 1 month ago by javinavarrete63.
-
AuthorPosts
-
September 20, 2021 at 6:15 am #102237javinavarrete63Member
Hi, I have 2 questions about scheduler
1. In a repeat event when I move one item of the repeat event out, there is a new context menu button, ‘delete’, what is its function ?
2. In a repeat event when I edit it, there are 2 options, what’s the event for the edit simple event button?
ThanksSeptember 20, 2021 at 10:26 am #102241YavorDashevMemberHi Javi Navarrete,
I would like to answer your questions in a convenient way:
1. Repeating event occurances are treated as date occurrences of the event instead of being separate events. Each occurrence has a unique date that the event repeats on. An occurrence can be modified. When modified it is treated as an exception of the repeating Event, that is why in the context menu the ‘Delete’ option is displayed too.
More info about this you can find in the API docs of the Scheduler component: https://www.htmlelements.com/docs/scheduler-events/
2. For this I have created a code snippet which will enable you to have this type of functionality:window.onload= function () { const scheduler = document.getElementById('scheduler'); scheduler.addEventListener('editDialogOpening', (event) => { const eventDetails = event.detail; if (eventDetails.type === 'confirm') { setTimeout(() => { const dialogButtons= eventDetails.target.querySelectorAll('.smart-scheduler-window-button'); for( let i= 0; i < dialogButtons.length; i++ ) { dialogButtons[i].addEventListener('click', () => { console.log('dialog button clicked'); }) } }, 100); } }); }
Let me know if that works for you!
Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
Smart UI Team
https://www.htmlelements.com/September 20, 2021 at 12:01 pm #102242javinavarrete63MemberI’ll try it
ThanksSeptember 21, 2021 at 8:45 am #102247javinavarrete63MemberHi, I’ll change my first question,
How could I delete a single event from a repeat event
Example: I have a repeat event from 1st January to 31st December, but I have holidays so I want to delete some days between
Is this functionality implented? In that case, what’s the event I have to use?
ThanksSeptember 21, 2021 at 9:52 am #102251YavorDashevMemberHi Javi Navarrete,
Yes the Scheduler component support such type of functionality using thehideNonworkingWeekdays
andnonworkingDays
properties.
Demo for it: https://www.htmlelements.com/demos/scheduler/hide-view-days/
Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
Smart UI Team
https://www.htmlelements.com/September 21, 2021 at 2:28 pm #102256javinavarrete63MemberI’m sorry, but that wasn’t my question, maybe my fault.
I mean if I can delete a day in a repeat event.
Example: I have a repeat event from monday to friday, and I want to delete this wednesday but only this one, could I do it?
Thank you again.
September 22, 2021 at 9:06 am #102276YavorDashevMemberHi Javi Navarrete,
The Scheduler component doesn’t support this type of functionality because the repeat exceptions can only remove the whole repeating event.
However I will add a work item as a feature request for this functionality.
Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
Smart UI Team
https://www.htmlelements.com/September 23, 2021 at 3:37 pm #102294YavorDashevMemberHi Javi Navarrete,
I guess there has been some misunderstanding from my side.
When you have a repeating event which repeats each day from monday to friday you can remove the repeated event by using theexceptions
property of the event.
Code snippet for this:{ label: 'Design Review', dateStart: new Date(currentYear, currentMonth, 1), dateEnd: new Date(currentYear, currentMonth, 2), allDay: true, backgroundColor: '#388E3C', repeat: { repeatFreq: 'daily', repeatInterval: 1, repeatEnd: 15, exceptions: [ { date: new Date(currentYear, currentMonth, 2), label: 'Official Holliday', backgroundColor: '#64DD17', hidden: true }, { date: new Date(currentYear, currentMonth, 7), label: 'Day off', hidden: true }, { date: new Date(currentYear, currentMonth, 15), label: 'Day off', hidden: true }, { date: new Date(currentYear, currentMonth, 9), label: 'Rescheduled. Simon is not available', dateStart: new Date(currentYear, currentMonth, 8), dateEnd: new Date(currentYear, currentMonth, 9), backgroundColor: '#2196F3' } ] } },
Also demo for repeating events: https://www.htmlelements.com/demos/scheduler/repeating-events/
Let me know what you think!
Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
Smart UI Team
https://www.htmlelements.com/September 28, 2021 at 6:48 am #102303javinavarrete63MemberHi
Yeah, that’s what I mean, but I need an event to know that the user has clicked on the delete button
Thank you -
AuthorPosts
- You must be logged in to reply to this topic.