Okay I have set the Quick popup to false and have tried to implement both OnCellClick and OnEventClick to force open the editor popup. However, When I try and type
await Schedule.OpenEditorAsync(args, CurrentAction.Add);
I get an error under OpenEditorAsync.
It says that Schedule<Jobs> does not contain a definition for it.
When I try and type it as
await Schedule.OpenEditor(args, CurrentAction.Add);
The program will load and I can click on a cell or event. However, the moment I do i get an error in the program that says the specified cast is not valid.
I am trying to create my own page that can popup when I click on an event
public async Task OnCellClick(CellClickEventArgs args)
{
args.Cancel = true;
await ScheduleRef.OpenEditorAsync(args, CurrentAction.Add); //To open editor window on cell click
}
public async Task OnEventClick(EventClickArgs<AppointmentData> args)
{
args.Cancel = true;
await ScheduleRef.OpenEditorAsync(args.Event, CurrentAction.Save); //To open the editor on event click
} |
Okay, updating it did get rid of the error when trying to type OpenEditorAsync. However, when i load the program and click on an event or a cell, this error still pops up in the internet console:
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Specified cast is not valid.
System.InvalidCastException: Specified cast is not valid.
at Syncfusion.Blazor.Schedule.Internal.ResourceRenderer`2[[WebJS.Shared.Objects.Installers, WebJS.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int32[], System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].OnComplete()
at Syncfusion.Blazor.Schedule.Internal.ResourceRenderer`2.<OnParametersSetAsync>d__34[[WebJS.Shared.Objects.Installers, WebJS.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int32[], System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
<SfSchedule TValue="AppointmentData" @ref="@ScheduleRef" Width="100%" Height="550px" ShowQuickInfo="false" @bind-SelectedDate="@CurrentDate">
<ScheduleEvents TValue="AppointmentData" OnEventClick="OnEventClick" OnCellClick="OnCellClick"></ScheduleEvents> <ScheduleGroup Resources="@Resources"></ScheduleGroup> <ScheduleResources> <ScheduleResource TItem="ResourceData" TValue="int[]" DataSource="@OwnersData" Field="OwnerId" Title="Owner" Name="Owners" TextField="OwnerText" IdField="Id" GroupIDField="OwnerGroupId" ColorField="OwnerColor" AllowMultiple="true"></ScheduleResource> </ScheduleResources> <ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings> <ScheduleViews> <ScheduleView Option="View.Day"></ScheduleView> <ScheduleView Option="View.Week"></ScheduleView> <ScheduleView Option="View.WorkWeek"></ScheduleView> <ScheduleView Option="View.Month"></ScheduleView> <ScheduleView Option="View.Agenda"></ScheduleView> </ScheduleViews> </SfSchedule> |