The appointment drag and drop functionality of the Scheduler does not work on mobile devices. When you try to drag an item, the item does not move.
You can test it by running the Scheduler overview demo by using Chrome's mobile device emulator and trying to drag and drop an appointment.
I'm in the same situation as the OP in this post: https://www.telerik.com/forums/how-do-you-always-edit-series-when-editing-a-recurring-appointment
In my case, I'm working with with the Blazor Scheduler Component. How can I disable the prompt and automatically select "Edit the series"? Or at least "disable" the "Edit this occurrence" button when updating/deleting an appointment?
---
ADMIN EDIT
Note: You may also check the Differentiate "edit current occurrence" and "edit the series" in the RecurrenceDialog feature request as the implementation of both features will most likely be covered in one release.
Please comment with suggestions on how you would like to see this feature exposed. Ideally it might have to be dynamic so you can toggle it based on conditions, so perhaps it could be a parameter (not flexible), an event argument to OnEdit, or a separate event/setting.
Here is a sample code you can try to achieve this - comments in the code explain how the templates are used to capture the edit action and some JS is used to fake-click the button to simulate a user choice:
@inject IJSRuntime _jsInterop
@* this errors suppression is a hack to make this sample succinct
move this script to a proper place for a real app*@
<script suppress-error="BL9992">
function clickSchedulerPromptButton(btnIndex) {
setTimeout(function () {
var buttons = document.querySelectorAll(".k-window-content .text-right button");
if (buttons && buttons.length >= btnIndex) {
var chosenButton = buttons[btnIndex];
chosenButton.click();
}
}, 50);
}
</script>
@* appearance setting for the template - make the custom template tall as the appointment to capture all clicks *@
<style>
.tallAppt {
height: 100%;
}
</style>
<TelerikScheduler Data="@Appointments"
OnUpdate="@UpdateAppointment"
OnCreate="@AddAppointment"
OnDelete="@DeleteAppointment"
AllowCreate="true" AllowDelete="true" AllowUpdate="true"
@bind-Date="@StartDate" Height="600px" @bind-View="@CurrView">
<ItemTemplate>
@{
SchedulerAppointment appt = context as SchedulerAppointment;
}
<div title="@appt.Start - @appt.End" class="tallAppt" @ondblclick="@( () => ChooseEditMode(appt) )"><div class="k-event-template">@appt.Title</div></div>
</ItemTemplate>
<AllDayItemTemplate>
@{
SchedulerAppointment appt = context as SchedulerAppointment;
}
<div title="@appt.Start.ToShortDateString() - @appt.Title" class="tallAppt" @ondblclick="@( () => ChooseEditMode(appt) )"><div class="k-event-template">@appt.Title</div></div>
</AllDayItemTemplate>
<SchedulerViews>
<SchedulerDayView StartTime="@DayStart" />
<SchedulerWeekView StartTime="@DayStart" />
<SchedulerMultiDayView StartTime="@DayStart" NumberOfDays="10" />
</SchedulerViews>
</TelerikScheduler>
@code {
//async void so we don't block the execution
//we will have a small timeout in the script to let it wait for the popup
async void ChooseEditMode(SchedulerAppointment appt)
{
// check if we have a recurring appointment or a member of one
if (appt.RecurrenceId != null || !string.IsNullOrEmpty(appt.RecurrenceRule))
{
int btnIndexToClick = 0;//the first button - edit instance
// make it 1 for the second button - the series
await _jsInterop.InvokeVoidAsync("clickSchedulerPromptButton", btnIndexToClick);
}
}
//the rest is sample data and sample CUD operations handling
// sample data and scheduler settings
public SchedulerView CurrView { get; set; } = SchedulerView.Week;
public DateTime StartDate { get; set; } = new DateTime(2019, 12, 2);
public DateTime DayStart { get; set; } = new DateTime(2000, 1, 1, 8, 0, 0); //the time portion is important
List<SchedulerAppointment> Appointments { get; set; }
async Task UpdateAppointment(SchedulerUpdateEventArgs args)
{
SchedulerAppointment item = (SchedulerAppointment)args.Item;
await MyService.Update(item);
await GetSchedulerData();
}
async Task AddAppointment(SchedulerCreateEventArgs args)
{
SchedulerAppointment item = args.Item as SchedulerAppointment;
await MyService.Create(item);
await GetSchedulerData();
}
async Task DeleteAppointment(SchedulerDeleteEventArgs args)
{
SchedulerAppointment item = (SchedulerAppointment)args.Item;
await MyService.Delete(item);
await GetSchedulerData();
}
public class SchedulerAppointment
{
public Guid Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public bool IsAllDay { get; set; }
public string RecurrenceRule { get; set; }
public List<DateTime> RecurrenceExceptions { get; set; }
public Guid? RecurrenceId { get; set; }
public SchedulerAppointment()
{
Id = Guid.NewGuid();
}
}
async Task GetSchedulerData()
{
Appointments = await MyService.Read();
}
protected override async Task OnInitializedAsync()
{
await GetSchedulerData();
}
// the following static class mimics an actual data service that handles the actual data source
// replace it with your actual service through the DI, this only mimics how the API can look like and works for this standalone page
public static class MyService
{
private static List<SchedulerAppointment> _data { get; set; } = new List<SchedulerAppointment>()
{
new SchedulerAppointment
{
Title = "Board meeting",
Description = "Q4 is coming to a close, review the details.",
Start = new DateTime(2019, 12, 5, 10, 00, 0),
End = new DateTime(2019, 12, 5, 11, 30, 0)
},
new SchedulerAppointment
{
Title = "Vet visit",
Description = "The cat needs vaccinations and her teeth checked.",
Start = new DateTime(2019, 12, 2, 11, 30, 0),
End = new DateTime(2019, 12, 2, 12, 0, 0)
},
new SchedulerAppointment
{
Title = "Planning meeting",
Description = "Kick off the new project.",
Start = new DateTime(2019, 12, 6, 9, 30, 0),
End = new DateTime(2019, 12, 6, 12, 45, 0)
},
new SchedulerAppointment
{
Title = "Trip to Hawaii",
Description = "An unforgettable holiday!",
IsAllDay = true,
Start = new DateTime(2019, 11, 27),
End = new DateTime(2019, 12, 05)
},
new SchedulerAppointment
{
Title = "Morning run",
Description = "Some time to clear the head and exercise.",
Start = new DateTime(2019, 11, 27, 9, 0, 0),
End = new DateTime(2019, 11, 27, 9, 30, 0),
RecurrenceRule = "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR"
}
};
public static async Task Create(SchedulerAppointment itemToInsert)
{
itemToInsert.Id = Guid.NewGuid();
_data.Insert(0, itemToInsert);
}
public static async Task<List<SchedulerAppointment>> Read()
{
return await Task.FromResult(_data);
}
public static async Task Update(SchedulerAppointment itemToUpdate)
{
var index = _data.FindIndex(i => i.Id == itemToUpdate.Id);
if (index != -1)
{
_data[index] = itemToUpdate;
}
}
public static async Task Delete(SchedulerAppointment itemToDelete)
{
if (itemToDelete.RecurrenceId != null)
{
// a recurrence exception was deleted, you may want to update
// the rest of the data source - find an item where theItem.Id == itemToDelete.RecurrenceId
// and remove the current exception date from the list of its RecurrenceExceptions
}
if (!string.IsNullOrEmpty(itemToDelete.RecurrenceRule) && itemToDelete.RecurrenceExceptions?.Count > 0)
{
// a recurring appointment was deleted that had exceptions, you may want to
// delete or update any exceptions from the data source - look for
// items where theItem.RecurrenceId == itemToDelete.Id
}
_data.Remove(itemToDelete);
}
}
}
---
I want to easily print the Scheduler calendar - month view, week view and more.
===
ADMIN EDIT
===
A possible approach for the time being is to implement printing functionality for the Scheduler in a similar fashion to how the Grid is printed here https://github.com/telerik/blazor-ui/tree/master/grid/print.
The approach relies on using JavaScript to invoke the browser print() method. Using CSS and @media print, you can customize the page and specify which elements should be visible when printing. For example, you may hide the toolbar and footer of the component, so only the calendar is visible.
Here is a runnable sample that demonstrates the approach: https://blazorrepl.telerik.com/cnutklOC55T5sV0J15.
Now that we can have more than 2 events in a day in Month View, we need to add an AppointmentHeight parameter to be able to make the appointments taller in height to accommodate longer titles.
ADMIN EDIT
An alternative for the time being is to show the longer content by using the appointment templates and the Tooltip component. For example:
https://github.com/telerik/blazor-ui/tree/master/scheduler/appointment-tooltips
I'd like to have a data virtualization feature (similar to the OnRead event), so I can load only small chunks of data (appointments) specifically for the current page/view.
===
ADMIN EDIT
===
Currently, you can achieve similar functionality by handling the DateChanged and ViewChanged events of the Scheduler to load only the relevant appointments for the selected period.
You can find an example here: Load Scheduler Appointments on Demand.
The Timeline view currently does not provide the "Show business hours" option as in the other views.
Please add that for the Timeline view similar to the jQuery version of the component.
===
ADMIN EDIT
===
For the time being, you can achieve this functionality with a custom approach by programmatically setting the StartTime and EndTime of the view to equal the WorkDayStart and WorkDayEnd.
Here is a basic example: https://blazorrepl.telerik.com/QyEhvjbO07j1ZvID42.
Hello,
I use the scheduler component with grouping ressources on a timeline view.
When there is only one ressource for the second group, there is no text showing on the view.
It works with 2 ressources.
I try over your demo and i have the same result.
https://blazorrepl.telerik.com/GyYAmBGE22N2CcIQ27
When I use 2 ressources it works.
Thank you
I want to be able to limit the Scheduler to a minimum and/or maximum date.
---
ADMIN EDIT
---
This request could be revised in two separate tracks:
Please share your thoughts on how you'd expect it to be implemented.
I am really looking to try to do something like this in Blazor: ASP.NET MVC Scheduler Hierarchical Grouping Demo | Telerik UI for ASP.NET MVC
In MVC, this feature is implemented with the dataParentValueField.
I want to add more fields to the scheduler create/edit popup. Currently, this is possible by creating a custom edit form. However, this customization would be easier if the Scheduler exposed a Popup Form Template similar to the Grid.
===
ADMIN EDIT
===
A necessary prerequisite for exposing this is to first add a State feature in the Scheduler. This will allow programmatic control over the edited item.
The appointments at the start of the day seem accurate. If you scroll down, the position of the appointments does not line up with the grid line for the hour that it starts at or ends at. The issue can be observed in the live demo.
I am trying to look at the times 7pm - midnight. But if I set the end time to midnight, I get an error that the end time has to be greater than the start time. How do I set the timeline to show 7pm - midnight or 8pm - 2am?
I tried including the next date in the EndTime but the Scheduler does not take the date into consideration, it checks only the time portion.
Support the recurrence rule to create multiple appointments per time slot. Examples of such rules are:
FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=08,09,10,11,12,13,14,15,16;BYMINUTE=50
If the Start and End match exactly, the rendering of the Scheduler breaks in Day view. If another view is used, the event looks as if it is rendered on the previous day.
===
ADMIN EDIT
===
A possible workaround for the time being is to use a custom edit form and implement some kind of validation that prevents the user from selecting the same value for the Start and End of an event.
Is there a way to customize the resource grouping's header (i.e. Alex, Bob, Charlie)? I understand it displays the text from the Resource, but I would like to be able to customize the HTML displayed so that I can add a tooltip. Would you have a suggestion as to how I can accomplish this?